-
Notifications
You must be signed in to change notification settings - Fork 2
[Location] 카카오 자동차 api 응답값 제조 #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package com.back.web7_9_codecrete_be.domain.location.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Data; | ||
|
|
||
| @Data | ||
| @AllArgsConstructor | ||
| public class KakaoRouteFeResponse { //경유지까지의 인덱스, 거리, 시간, 좌표를 나타냄 | ||
| private int routeIndex; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 응답에는 @Schema 써서 설명을 붙여주면 좋을 것 같습니다!
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 넵 스웨거 설정은 방학중에 다 완료해놓겠습니다! |
||
| private int distance; | ||
| private int duration; | ||
| private Object from; | ||
| private Object to; | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.back.web7_9_codecrete_be.domain.location.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Data; | ||
|
|
||
| import java.util.List; | ||
| @Data | ||
| @AllArgsConstructor | ||
| public class KakaoRouteSectionFeResponse { //프론트에서 원하는 전체 거리, 시간, 좌표로, section에서는 경유지를 거치는 값들을 저장 | ||
| private int totalDistance; | ||
| private int totalDuration; | ||
| private List<KakaoRouteFeResponse> sections; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package com.back.web7_9_codecrete_be.domain.location.dto.request; | ||
|
|
||
| import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
| import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
| import lombok.Data; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Data | ||
| public class KakaoRouteTransitRequest { //Kakao mobility api에서 경유지 추가 response | ||
|
|
||
| private Origin origin; | ||
| private Destination destination; | ||
| private List<Waypoint> waypoints; | ||
|
|
||
| private String priority; | ||
| private String car_fuel; | ||
| private boolean car_hipass; | ||
| private boolean alternatives; | ||
| private boolean road_details; | ||
| private boolean summary; | ||
|
|
||
| @Data | ||
| public static class Origin { | ||
| private double x; | ||
| private double y; | ||
| private int angle; | ||
| } | ||
|
|
||
| @Data | ||
| public static class Destination { | ||
| private double x; | ||
| private double y; | ||
| } | ||
|
|
||
| @Data | ||
| public static class Waypoint { | ||
| private String name; | ||
| private double x; | ||
| private double y; | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,71 +1,98 @@ | ||
| package com.back.web7_9_codecrete_be.domain.location.dto.response; | ||
|
|
||
| import lombok.Getter; | ||
| import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
| import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
| import lombok.Data; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Getter | ||
| @Data | ||
| @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| public class KakaoRouteTransitResponse { | ||
|
|
||
| private String transId; | ||
| private List<Route> routes; | ||
|
|
||
| @Getter | ||
| @Data | ||
| @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| public static class Route { | ||
| private int resultCode; | ||
| private String resultMsg; | ||
| private Summary summary; | ||
| private List<Section> sections; | ||
| } | ||
|
|
||
| @Getter | ||
| @Data | ||
| @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| public static class Summary { | ||
| private Origin origin; | ||
| private Destination destination; | ||
| private List<Waypoint> waypoints; // ✅ 경유지(요청값) | ||
|
|
||
| private List<Waypoint> waypoints; | ||
| private String priority; | ||
| private Bound bound; // optional일 수 있음 | ||
| private Fare fare; | ||
|
|
||
| private int distance; // meters | ||
| private int duration; // seconds | ||
| private int distance; | ||
| private int duration; | ||
| } | ||
|
|
||
| @Getter | ||
| @Data | ||
| public static class Origin { | ||
| private String name; | ||
| private double x; | ||
| private double y; | ||
| } | ||
|
|
||
| @Getter | ||
| @Data | ||
| public static class Destination { | ||
| private String name; | ||
| private double x; | ||
| private double y; | ||
| } | ||
|
|
||
| @Getter | ||
| @Data | ||
| public static class Waypoint { | ||
| private String name; | ||
| private double x; | ||
| private double y; | ||
| } | ||
|
|
||
| @Getter | ||
| @Data | ||
| public static class Bound { | ||
| private double minX; | ||
| private double minY; | ||
| private double maxX; | ||
| private double maxY; | ||
| } | ||
|
|
||
| @Data | ||
| public static class Fare { | ||
| private int taxi; | ||
| private int toll; | ||
| } | ||
|
|
||
| @Getter | ||
| @Data | ||
| @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| public static class Section { | ||
| private List<Road> roads; | ||
| private List<Guide> guides; | ||
| private int distance; | ||
| private int duration; | ||
| private Bound bound; // summary=false일 때만 올 수 있음 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. false일때만 올 수 있다면 해당 클래스를 따로 빼는 것도 괜찮을 것 같습니다.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 넵 알겠습니다! |
||
| private List<Road> roads; // summary=false일 때만 올 수 있음 | ||
| private List<Guide> guides; // summary=false일 때만 올 수 있음 | ||
| } | ||
|
|
||
| @Getter | ||
| @Data | ||
| @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| public static class Road { | ||
| private String name; | ||
| private int distance; | ||
| private int duration; | ||
| private double trafficSpeed; | ||
| private int trafficState; | ||
| private List<Double> vertexes; | ||
| } | ||
|
|
||
| @Getter | ||
| @Data | ||
| @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| public static class Guide { | ||
| private String name; | ||
| private double x; | ||
|
|
@@ -74,6 +101,6 @@ public static class Guide { | |
| private int duration; | ||
| private int type; | ||
| private String guidance; | ||
| private int road_index; | ||
| private int roadIndex; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import가 안되는 문제가 있었던걸까요? 아니면 중복된 클래스 명이 있었던 걸까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그냥 route0보다는 route로 하는게 보기 편해서 바꿨습니다,,