コード例 #1
0
  @Override
  public LocationDTO addLocation(String location, String userId) {

    Location loc = new Location();
    // loc = convertLocation(location);

    loc = locationManager.addLocation(location, userId);

    return convertLocationDTO(loc);
  }
コード例 #2
0
  @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);
  }
コード例 #3
0
  @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;
  }
コード例 #4
0
  @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;
  }