@Override public LocationDTO addLocation(String location, String userId) { Location loc = new Location(); // loc = convertLocation(location); loc = locationManager.addLocation(location, userId); return convertLocationDTO(loc); }
@Override public void deleteLocation(String idUser, List<LocationDTO> loc) { List<Location> locations = new ArrayList<Location>(); boolean result = false; for (int i = 0; i < loc.size(); i++) { locations.add(convertLocation(loc.get(i))); } locationManager.deleteLocationByUserId(idUser, locations); }
@Override public List<LocationDTO> getLocations(String id) { // UserDTO userDTO = getUserConnected(); List<LocationDTO> locationsDTO = new ArrayList<LocationDTO>(); List<Location> listLocation = locationManager.getLocations(id); for (int i = 0; i < listLocation.size(); i++) { locationsDTO.add(convertLocationDTO(listLocation.get(i))); } return locationsDTO; }
@Override public List<LocationDTO> getLocations(LocationDTO initialLocation) { List<Location> result = new ArrayList<Location>(); List<LocationDTO> resultDTO = new ArrayList<LocationDTO>(); result = locationManager.getLocations(convertLocation(initialLocation)); for (int i = 0; i < result.size(); i++) { resultDTO.add(convertLocationDTO(result.get(i))); } return resultDTO; }