public @ResponseBody CustomHealthCenterResponse fetchHealthCenters() {
CustomHealthCenterResponse response = new CustomHealthCenterResponse();
List<HealthCenter> healthCenters = healthCenterService.getAllHealthCenters();
List<HealthCenterDTO> hcs = new ArrayList<HealthCenterDTO>();
for (HealthCenter hc : healthCenters) {
HealthCenterDTO dto = new HealthCenterDTO();
dto.setCenterId(hc.getCenterId());
dto.setCenterName(hc.getCenterName());
dto.setCenterPhone(hc.getCenterPhone());
hcs.add(dto);
}
response.setPage("1");
response.setRows(hcs);
response.setTotal("10");