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());