Package org.sis.ancmessaging.json

Examples of org.sis.ancmessaging.json.CustomTransporterResponse


 
  @RequestMapping(value = "gettransporters", method = RequestMethod.GET)
  public @ResponseBody CustomTransporterResponse fetchTransporters(@RequestParam("postId") int postId,
      @RequestParam("page") int page, @RequestParam("rows") int rows) {
   
    CustomTransporterResponse response = new CustomTransporterResponse();
    StringBuilder sb = new StringBuilder();
   
    List<Transporter> transporters = healthPostService.getTransportersForHealthPost(postId, rows, page, sb);
    List<TransporterDTO> transporterDTOs = new ArrayList<TransporterDTO>();
    for (Transporter transporter : transporters) {
      TransporterDTO tDTO = new TransporterDTO();
      tDTO.setTransporterId(transporter.getTransporterId());
      tDTO.setFullName(transporter.getFullName());
      tDTO.setPhoneNumber(transporter.getPhoneNumber());
      tDTO.setPostId(postId);
      transporterDTOs.add(tDTO);
    }
    response.setPage(String.valueOf(page));
    response.setRows(transporterDTOs);
    response.setTotal(sb.toString());
    response.setRecords(String.valueOf(transporterDTOs.size()));
    return response;
  }
View Full Code Here

TOP

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

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.