Commit ecc06cce authored by Imalka L.A.'s avatar Imalka L.A.

add disease desc for response

parent 7dc6fa7b
......@@ -10,6 +10,9 @@ public class SolutionsResponse<T> {
@JsonProperty("disease")
private String disease;
@JsonProperty("diseaseDescription")
private String diseaseDescription;
@JsonProperty("solution")
private T solution;
......
......@@ -27,10 +27,13 @@ import javax.persistence.*;
@Column(name = "disease_name", length = 100, nullable = false,updatable = true)
private String diseaseName;
@Column(name = "disease_description", length = 1000, nullable = false,updatable = true)
private String diseaseDescription;
@Column(name = "solution", length = 100, nullable = false, unique = true, updatable = true)
private String solution;
@Column(name = "solution_description", length = 100, nullable = false, unique = true, updatable = true)
@Column(name = "solution_description", length = 1000, nullable = false, unique = true, updatable = true)
private String solutionDescription;
@Column(name = "solution_type", length = 100, nullable = false,updatable = true)
......
......@@ -30,6 +30,7 @@ public class SolutionServiceImpl implements SolutionService {
List<SolutionResponse> solutionResponse = new ArrayList<>();
SolutionsResponse returnValue = new SolutionsResponse();
String diseaseDescription = null;
if (page > 0)
page = page - 1;
......@@ -41,9 +42,11 @@ public class SolutionServiceImpl implements SolutionService {
for (SolutionList entity : resource) {
solutionResponse.add(mapper.map(entity, SolutionResponse.class));
returnValue.setDisease(entity.getDiseaseName());
returnValue.setDiseaseDescription(entity.getDiseaseDescription());
}
returnValue.setDisease(disease);
returnValue.setSolution(solutionResponse);
returnValue.setCurrentPage(resourcePage.getNumber() + 1);
returnValue.setTotalItems(resourcePage.getTotalElements());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment