-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
589d524
commit 08fdcd7
Showing
2 changed files
with
75 additions
and
68 deletions.
There are no files selected for viewing
69 changes: 37 additions & 32 deletions
69
server/src/main/java/app/seok/picnicmap/geolocation/GeoLocationResponseDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,48 @@ | ||
package app.seok.picnicmap.geolocation; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
|
||
@Setter | ||
@Getter | ||
public class GeoLocationResponseDTO { | ||
private Integer status; | ||
private String massage; | ||
private Position data; | ||
|
||
@Setter | ||
@Getter | ||
public static class Position { | ||
private double lng; | ||
private double lat; | ||
} | ||
private Integer status; | ||
private String massage; | ||
private Position data; | ||
@JsonIgnore | ||
private String returnMessage; | ||
|
||
@Setter | ||
@Getter | ||
public static class Position { | ||
|
||
private double lng; | ||
private double lat; | ||
} | ||
|
||
public static GeoLocationResponseDTO OkFromGeoLocation(GeoLocation dbResult) { | ||
double lng = dbResult.getLng(); | ||
double lat = dbResult.getLat(); | ||
GeoLocationResponseDTO geoLocationResponse = new GeoLocationResponseDTO(); | ||
geoLocationResponse.setStatus(200); | ||
geoLocationResponse.setMassage("Success " + dbResult.getR2()); | ||
Position position = new Position(); | ||
position.setLng(lng); | ||
position.setLat(lat); | ||
geoLocationResponse.setData(position); | ||
return geoLocationResponse; | ||
} | ||
|
||
public static GeoLocationResponseDTO OkFromGeoLocation(GeoLocation dbResult) { | ||
double lng = dbResult.getLng(); | ||
double lat = dbResult.getLat(); | ||
GeoLocationResponseDTO geoLocationResponse = new GeoLocationResponseDTO(); | ||
geoLocationResponse.setStatus(200); | ||
geoLocationResponse.setMassage("Success"); | ||
Position position = new Position(); | ||
position.setLng(lng); | ||
position.setLat(lat); | ||
geoLocationResponse.setData(position); | ||
return geoLocationResponse; | ||
} | ||
public static GeoLocationResponseDTO Ok() { | ||
GeoLocationResponseDTO geoLocationResponse = new GeoLocationResponseDTO(); | ||
geoLocationResponse.setStatus(200); | ||
Position position = new Position(); | ||
position.setLng(126.977380); | ||
position.setLat(37.575843); | ||
geoLocationResponse.setData(position); | ||
return geoLocationResponse; | ||
} | ||
public static GeoLocationResponseDTO Ok() { | ||
GeoLocationResponseDTO geoLocationResponse = new GeoLocationResponseDTO(); | ||
geoLocationResponse.setMassage("위치를 확인해 주세요."); | ||
geoLocationResponse.setStatus(200); | ||
Position position = new Position(); | ||
position.setLng(126.977380); | ||
position.setLat(37.575843); | ||
geoLocationResponse.setData(position); | ||
return geoLocationResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters