}
@RequestMapping(value = "getgotts", method = RequestMethod.GET)
public @ResponseBody CustomGottResponse fetchGotts(@RequestParam("postId") int postId,
@RequestParam("rows") int rows, @RequestParam("page") int page) {
CustomGottResponse response = new CustomGottResponse();
StringBuilder sb = new StringBuilder();
//HealthPost healthPost = healthPostService.findById(postId);
List<Gott> gotts = healthPostService.getGottsForHealthPost(postId, rows, page, sb);
List<GottDTO> gottDTOs = new ArrayList<GottDTO>();
for (Gott gott : gotts) {
GottDTO gDTO = new GottDTO();
gDTO.setGottId(gott.getGottId());
gDTO.setGottName(gott.getGottName());
gDTO.setPostId(postId);
gottDTOs.add(gDTO);
}
response.setPage(String.valueOf(page));
response.setRows(gottDTOs);
response.setTotal(sb.toString());
response.setRecords(String.valueOf(gottDTOs.size()));
return response;
}