-
Notifications
You must be signed in to change notification settings - Fork 1
[release] 진행상황 Main 브랜치에 반영 #141
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
079aef6
09754f9
21b74d8
e643220
8e3de10
f19b48f
017eaa8
cc7848e
1aec814
4c014e9
1a47c85
174baca
963443c
650b444
4875163
89dfca8
a6aa693
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,31 @@ | ||
| package com.wayble.server.common.config; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import java.net.http.HttpClient; | ||
| import java.time.Duration; | ||
|
|
||
| @Configuration | ||
| @RequiredArgsConstructor | ||
| public class HttpClientConfig { | ||
|
|
||
| @Value("${http.client.connect-timeout:10}") | ||
| private int connectTimeout; | ||
|
|
||
| @Value("${http.client.request-timeout:30}") | ||
| private int requestTimeout; | ||
|
|
||
| @Bean | ||
| public HttpClient httpClient() { | ||
| return HttpClient.newBuilder() | ||
| .connectTimeout(Duration.ofSeconds(connectTimeout)) | ||
| .build(); | ||
| } | ||
|
|
||
| @Bean | ||
| public Duration httpRequestTimeout() { | ||
| return Duration.ofSeconds(requestTimeout); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.wayble.server.direction.dto; | ||
|
|
||
| import com.wayble.server.direction.entity.transportation.Edge; | ||
| import org.springframework.data.util.Pair; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| public record TransportationGraphDto( // 노드별 연결 정보와 엣지별 가중치를 함께 관리하기 위한 dto | ||
| Map<Long, List<Edge>> graph, // 노드별 연결 정보 | ||
| Map<Pair<Long, Long>, Integer> weightMap // 엣지별 가중치 | ||
| ) {} |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.wayble.server.direction.dto.response; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record BusInfo(List<BusArrival> buses, String stationName) { | ||
| public record BusArrival( | ||
| String busNumber, | ||
| String arrival1, | ||
| String arrival2 | ||
| ) {} | ||
| } | ||
|
Comment on lines
+1
to
+11
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. 💡 Verification agent 🧩 Analysis chain동일 명칭 DTO 중복/혼선 위험: TransportationResponseDto.BusInfo와 충돌 가능 본 파일의 BusInfo와 TransportationResponseDto.BusInfo가 공존하면 import 충돌·오용 위험이 큽니다. 실제 서비스는 TransportationResponseDto.BusInfo를 반환하는 것으로 보이며, 이 파일이 미사용이라면 제거하거나 명확히 목적을 구분해 리네이밍(예: StationArrivalsResponse)하는 것을 권장합니다. 사용 중이라면 컨트롤러/서비스 반환 타입 정합성을 재검토해 주세요. 아래 스크립트로 본 BusInfo의 실제 사용 여부와 이름 충돌 가능성을 점검하세요. API로 노출할 DTO가 둘 필요가 없다면 하나로 통일해 주세요. 둘 다 필요하면 명칭을 분리하고 @Schema 문서화를 추가해 혼선을 줄이는 것을 권장합니다. 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "본 BusInfo(패키지 dto.response) 사용처:"
rg -n $'com\\.wayble\\.server\\.direction\\.dto\\.response\\.BusInfo' || true
rg -n $'\\bBusInfo\\b' | rg -n -v 'TransportationResponseDto' || true
echo
echo "TransportationResponseDto.BusInfo 사용처:"
rg -n $'TransportationResponseDto\\.BusInfo'Length of output: 1694 미사용 BusInfo DTO 제거 또는 명칭 변경 필요
🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| package com.wayble.server.direction.dto.response; | ||
|
|
||
| import com.wayble.server.direction.entity.DirectionType; | ||
| import org.springframework.lang.Nullable; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Schema(description = "대중교통 길찾기 응답 DTO") | ||
| public record TransportationResponseDto( | ||
| List<Step> routes, | ||
| PageInfo pageInfo | ||
| ) { | ||
| public record Step( | ||
| DirectionType mode, // 예: START, WALK, SUBWAY, BUS, FINISH | ||
| @Nullable List<MoveInfo> moveInfo, // 같은 Step으로 이동한 정류장(Node) 정보 (중간 정류장만) | ||
| @Nullable String routeName, | ||
| Integer moveNumber, // 같은 Step(route)로 이동한 횟수 | ||
| @Nullable BusInfo busInfo, // 버스일 경우에만 생성, 이외의 경우 null | ||
| @Nullable SubwayInfo subwayInfo, // 지하철일 경우에만 생성, 이외의 경우 null | ||
| String from, | ||
| String to | ||
| ) {} | ||
|
|
||
| public record PageInfo( | ||
| Integer nextCursor, | ||
| boolean hasNext | ||
| ) {} | ||
|
|
||
| public record MoveInfo( | ||
| String nodeName // 정류장(Node)의 stationName | ||
| ){} | ||
|
|
||
| public record BusInfo( | ||
| boolean isShuttleBus, // routeName에 "마포" 포함시 true | ||
| @Nullable List<Boolean> isLowFloor, // Open API(busType1,busType2) 기반 저상 여부 리스트 | ||
| @Nullable Integer dispatchInterval // Open API(term) 기반 배차간격 | ||
| ){} | ||
|
|
||
| public record SubwayInfo( | ||
| List<LocationInfo> wheelchair, | ||
| List<LocationInfo> elevator, | ||
| Boolean accessibleRestroom | ||
| ) {} | ||
|
|
||
| public record LocationInfo( | ||
| Double latitude, | ||
| Double longitude | ||
| ) {} | ||
|
|
||
| // 지하철 시설 정보 묶음 (서비스 내부에서 사용) | ||
| public record NodeInfo( | ||
| List<LocationInfo> wheelchair, | ||
| List<LocationInfo> elevator, | ||
| Boolean accessibleRestroom | ||
| ) {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package com.wayble.server.direction.external.opendata; | ||
|
|
||
| import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
|
||
| @ConfigurationProperties(prefix = "opendata.api") | ||
| public record OpenDataProperties( | ||
| String key, | ||
| String baseUrl, | ||
| String encodedKey, | ||
| Endpoints endpoints, | ||
| int timeout, | ||
| String userAgent, | ||
| String accept | ||
| ) { | ||
| public record Endpoints(String arrivals, String stationByName) {} | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,7 @@ | ||||||||||||||||||||||
| package com.wayble.server.direction.external.opendata.dto; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| public record Arrival ( | ||||||||||||||||||||||
| Integer busType1, // 1이면 저상 | ||||||||||||||||||||||
| Integer busType2, // 1이면 저상 | ||||||||||||||||||||||
| Integer term // 배차 간격 | ||||||||||||||||||||||
| ) {} | ||||||||||||||||||||||
|
Comment on lines
+3
to
+7
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. 💡 Verification agent 🧩 Analysis chainOpenDataResponse.Item과 타입 정합성 확인 및 정렬 BusInfoService가 busType1/busType2를 문자열 "1"과 비교하는 흐름이 보입니다. Arrival은 Integer로 선언되어 있어 매핑/파싱 불일치 가능성이 있습니다. OpenDataResponse.Item의 필드 타입과 일치시키는 게 안전합니다. 불일치 시 런타임 변환/비교 버그가 날 수 있습니다. 아래 스크립트로 OpenDataResponse.Item의 선언 타입과 BusInfoService 비교 로직을 확인하세요. String이라면 Arrival도 String으로 맞추는 것을 권장합니다. String으로 확인되면 다음과 같이 정렬을 권장합니다: -public record Arrival (
- Integer busType1, // 1이면 저상
- Integer busType2, // 1이면 저상
- Integer term // 배차 간격
-) {}
+public record Arrival (
+ String busType1, // "1"이면 저상
+ String busType2, // "1"이면 저상
+ String term // 배차 간격(분), 문자열로 수신되므로 파싱 필요
+) {}또는 Item이 Integer라면 BusInfoService의 비교 로직을 정수 비교로 정렬해 주세요. 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "OpenDataResponse.Item 선언부 인근:"
rg -n -A 8 -B 2 $'record\\s+Item\\s*\\(' src/main/java/com/wayble/server/direction/external/opendata/dto/OpenDataResponse.java
echo
echo "BusInfoService에서 busType/term 사용부:"
rg -n -A 2 -B 2 'busType1|busType2|term\\(' src/main/java/com/wayble/server/direction/service/BusInfoService.javaLength of output: 831 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "BusInfoService에서 busType1/busType2 및 term 사용 내역:"
rg -n -C 4 'busType1|busType2|term' src/main/java/com/wayble/server/direction/service/BusInfoService.javaLength of output: 911 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Arrival 생성 위치 확인:"
rg -n -C 3 'new Arrival' -n srcLength of output: 98 Arrival 필드 타입을 OpenDataResponse.Item과 일치시키세요 OpenDataResponse.Item의 busType1, busType2, term이 모두 String으로 선언되어 있는데, Arrival은 Integer로 선언되어 있어 매핑/파싱 불일치 가능성이 있습니다. 런타임 변환/비교 버그를 방지하려면 두 레코드의 필드 타입을 일치시키십시오. 예를 들어, Arrival을 다음과 같이 수정하세요: -public record Arrival(
- Integer busType1, // 1이면 저상
- Integer busType2, // 1이면 저상
- Integer term // 배차 간격
-) {}
+public record Arrival(
+ String busType1, // "1"이면 저상
+ String busType2, // "1"이면 저상
+ String term // 배차 간격(분), 문자열로 수신되므로 파싱 필요
+) {}만약 OpenDataResponse.Item이 Integer 타입으로 변경된다면, BusInfoService에서 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package com.wayble.server.direction.external.opendata.dto; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
|
||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| public record OpenDataResponse ( // 버스 정류장 id를 기반으로 배차시간, 저상버스 여부를 확인하는 엔드포인트 | ||
| @JsonProperty("comMsgHeader") ComMsgHeader comMsgHeader, | ||
| @JsonProperty("msgHeader") MsgHeader msgHeader, | ||
| @JsonProperty("msgBody") MsgBody msgBody | ||
| ) { | ||
| public record ComMsgHeader( | ||
| @JsonProperty("errMsg") String errMsg, | ||
| @JsonProperty("responseTime") String responseTime, | ||
| @JsonProperty("requestMsgID") String requestMsgID, | ||
| @JsonProperty("responseMsgID") String responseMsgID, | ||
| @JsonProperty("successYN") String successYN, | ||
| @JsonProperty("returnCode") String returnCode | ||
| ) {} | ||
| public record MsgHeader( | ||
| @JsonProperty("headerMsg") String headerMsg, | ||
| @JsonProperty("headerCd") String headerCd, | ||
| @JsonProperty("itemCount") Integer itemCount | ||
| ) {} | ||
|
|
||
| public record MsgBody( | ||
| @JsonProperty("itemList") List<Item> itemList | ||
| ) {} | ||
|
|
||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| public record Item( | ||
| @JsonProperty("busType1") String busType1, | ||
| @JsonProperty("busType2") String busType2, | ||
| @JsonProperty("term") String term, | ||
| @JsonProperty("busRouteId") String busRouteId | ||
| ) {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.wayble.server.direction.external.opendata.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
| import java.util.List; | ||
|
|
||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| public record StationSearchResponse( // 버스 정류장 id를 검색하는 엔드포인트 | ||
| StationSearchMsgBody msgBody | ||
| ) { | ||
| public record StationSearchMsgBody( | ||
| List<StationItem> itemList | ||
| ) {} | ||
|
|
||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| public record StationItem( | ||
| String stId, | ||
| String stNm, | ||
| String tmX, | ||
| String tmY | ||
| ) {} | ||
|
Comment on lines
+16
to
+20
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. 💡 Verification agent 🧩 Analysis chain좌표 타입 및 좌표계 변환 확인 필요 tmX/tmY가 문자열로 선언되어 있습니다. TM 좌표를 사용하는 경우, 서비스 레이어에서 WGS84(lat/lon)로 변환하는 경로가 있는지 확인 부탁드립니다. 가능하다면 숫자형(double/BigDecimal) 매핑이 후처리에 유리합니다. TM→WGS84 변환 로직 또는 사용 위치를 점검하려면 다음을 실행해 주세요: 🏁 Script executed: #!/bin/bash
# tmX/tmY 사용 및 변환 여부 탐색
rg -n "tmX|tmY|StationSearchResponse" -A 5Length of output: 8946 dto 및 서비스 레이어에서 TM 좌표 취급/변환 검토 필요
🤖 Prompt for AI Agents |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.wayble.server.direction.repository; | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| import com.wayble.server.direction.entity.transportation.Route; | ||
|
|
||
| public interface RouteRepository extends JpaRepository<Route, Long>{ | ||
|
|
||
| } |
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.
💡 Verification agent
🧩 Analysis chain
레거시 패키지 참조 잔재 여부 확인 권장
다른 코드에 기존 패키지(com.wayble.server.direction.dto.*)를 참조하는 부분이 남아있지 않은지 점검해주세요.
다음 스크립트로 레거시 import를 검색할 수 있습니다:
🏁 Script executed:
Length of output: 82
추가 검증을 위해 레거시 DTO 패키지에 대한 모든 import 참조를 검색해 주세요.
🏁 Script executed:
Length of output: 3572
레거시 DTO 패키지 참조 업데이트 필요
아래 파일들에 아직
com.wayble.server.direction.dto.*패키지 import가 남아있습니다. 모두 새로운 DTO 패키지 경로로 변경해주세요.위 파일들에서
import com.wayble.server.direction.dto.*를 삭제하고, 새로 정의된 DTO 패키지(import 경로)를 적용해 주세요.🤖 Prompt for AI Agents