Package org.sis.ancmessaging.json

Examples of org.sis.ancmessaging.json.CustomHealthPostResponse


  }
 
  @RequestMapping(value = "gethealthposts", method = RequestMethod.GET)
  public @ResponseBody CustomHealthPostResponse fetchHealthPosts(@RequestParam("centerId") int centerId,
      @RequestParam("rows") int rows, @RequestParam("page") int page) {
    CustomHealthPostResponse response = new CustomHealthPostResponse();
    //HealthCenter healthCenter = healthCenterService.findById(centerId);
    StringBuilder sb = new StringBuilder();
    List<HealthPost> healthPosts = healthPostService.getHealthPostsForCenter(centerId, rows, page, sb);
    List<HealthPostDTO> hps = new ArrayList<HealthPostDTO>();
    for (HealthPost hp : healthPosts) {
      HealthPostDTO healthPost = new HealthPostDTO();
      healthPost.setPostId(hp.getPostId());
      healthPost.setPostName(hp.getPostName());
      healthPost.setKebele(hp.getKebele());
      healthPost.setCenterId(centerId);
      hps.add(healthPost);
    }
    response.setPage(String.valueOf(page));
    response.setRows(hps);
    response.setTotal(sb.toString());
    response.setRecords(String.valueOf(hps.size()));
    return response;
  }
View Full Code Here

TOP

Related Classes of org.sis.ancmessaging.json.CustomHealthPostResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.