Skip to content

Commit 59bcb10

Browse files
authored
Merge pull request #75 from SWYP-mingling/fix/SW-75-midpoint-bug-fix
2 parents 67bd972 + 94009bd commit 59bcb10

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

‎src/main/java/swyp/mingling/domain/meeting/service/MidPointUseCase.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public List<GetMidPointResponse> execute(UUID meetingId) {
3333

3434
double midLat = 0.0;
3535
double midLon = 0.0;
36-
36+
3737
Set<String> sets = new HashSet<>();
3838

3939
for (DepartureListResponse departurelist : departurelists) {

‎src/main/java/swyp/mingling/external/SeoulMetroClient.java‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,28 @@ public SeoulMetroClient(@Qualifier("seoulMetroWebClient") WebClient webClient) {
2121
}
2222

2323
public SeoulMetroRouteResponse searchRoute(String startStationName, String endStationName) {
24-
String start = startStationName.replaceAll("역$", "");
25-
String end = endStationName.replaceAll("역$", "");
24+
25+
String start = startStationName;
26+
String end = endStationName;
27+
28+
if(start != null && !"서울역".equals(start)){
29+
start = start.replaceAll("역$", "");
30+
}
31+
32+
if(end != null && !"서울역".equals(end)){
33+
end = end.replaceAll("역$", "");
34+
}
35+
36+
String finalStart = start;
37+
String finalEnd = end;
38+
2639
String now = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
2740
// 지하철 운행시간 종료 후
2841
// String now = "2026-06-06 12:00:00";
2942
return webClient.get()
3043
.uri(uriBuilder -> {
3144
var uri = uriBuilder
32-
.pathSegment("getShtrmPath", "1", "5", start, end, now)
45+
.pathSegment("getShtrmPath", "1", "5", finalStart, finalEnd, now)
3346
.queryParam("schInclYn", "N")
3447
.build();
3548

‎src/main/resources/data.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ DELETE FROM `hot_place`;
22
INSERT INTO `hot_place` (`hot_place_id`, `name`, `latitude`, `longitude`, `line`) VALUES
33
(1, '강남', 37.49799, 127.027912, '2호선'),
44
(2, '홍대입구', 37.55679, 126.923708, '2호선'),
5-
(3, '서울', 37.554337, 126.971134, '1호선'),
5+
(3, '서울역', 37.554337, 126.971134, '1호선'),
66
(4, '잠실', 37.513262, 127.100159, '2호선'),
77
(5, '합정', 37.549457, 126.913808, '2호선'),
88
(6, '창동', 37.653007, 127.047806, '1호선'),

0 commit comments

Comments
 (0)