Skip to content

Commit b1ea73e

Browse files
authored
Merge pull request #83 from PinHouse/fix/외부-API-수정
🔥 fix : 외부 api 수정
2 parents c8a6901 + f3bf1cf commit b1ea73e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/main/java/com/pinHouse/server/platform/housing/complex/external/OdsayUtil.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
import org.springframework.web.reactive.function.client.WebClient;
1616
import org.springframework.web.util.UriComponentsBuilder;
1717

18-
import java.io.UnsupportedEncodingException;
19-
import java.net.URLEncoder;
20-
2118
@Slf4j
2219
@Component
2320
@RequiredArgsConstructor
@@ -34,18 +31,15 @@ public class OdsayUtil implements DistanceUtil {
3431
// =================
3532

3633
@Override
37-
public PathResult findPathResult(double startY, double startX, double endY, double endX)
38-
throws UnsupportedEncodingException {
39-
40-
String encodedApiKey = URLEncoder.encode(apiKey, "UTF-8");
34+
public PathResult findPathResult(double startY, double startX, double endY, double endX) {
4135

42-
String uri = UriComponentsBuilder.fromHttpUrl("https://api.odsay.com/v1/api/searchPubTransPathT")
36+
String uri = UriComponentsBuilder.fromUriString("https://api.odsay.com/v1/api/searchPubTransPathT")
4337
.queryParam("SX", startX)
4438
.queryParam("SY", startY)
4539
.queryParam("EX", endX)
4640
.queryParam("EY", endY)
47-
.queryParam("apiKey", encodedApiKey)
48-
.build(false) // 추가 인코딩 방지
41+
.queryParam("apiKey", apiKey)
42+
.build()
4943
.toUriString();
5044

5145
/// 값 호출

src/main/java/com/pinHouse/server/platform/housing/notice/application/service/ComplexFilterService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,18 @@ private String extractMetroCityName(String cityName) {
346346
* "경기도" → "경기"
347347
* "충청북도" → "충북"
348348
* "경상남도" → "경남"
349+
* "제주특별자치도" → "제주"
349350
*/
350351
private String shortenProvinceName(String province) {
351352
if (province == null || province.isBlank()) {
352353
return "";
353354
}
354355

356+
// "특별자치도" 제거 (제주)
357+
if (province.endsWith("특별자치도")) {
358+
return province.substring(0, province.length() - 5);
359+
}
360+
355361
// "도" 제거
356362
if (province.endsWith("도")) {
357363
String base = province.substring(0, province.length() - 1);

0 commit comments

Comments
 (0)