Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.util.UriComponentsBuilder;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

@Slf4j
@Component
@RequiredArgsConstructor
Expand All @@ -34,18 +31,15 @@ public class OdsayUtil implements DistanceUtil {
// =================

@Override
public PathResult findPathResult(double startY, double startX, double endY, double endX)
throws UnsupportedEncodingException {

String encodedApiKey = URLEncoder.encode(apiKey, "UTF-8");
public PathResult findPathResult(double startY, double startX, double endY, double endX) {

String uri = UriComponentsBuilder.fromHttpUrl("https://api.odsay.com/v1/api/searchPubTransPathT")
String uri = UriComponentsBuilder.fromUriString("https://api.odsay.com/v1/api/searchPubTransPathT")
.queryParam("SX", startX)
.queryParam("SY", startY)
.queryParam("EX", endX)
.queryParam("EY", endY)
.queryParam("apiKey", encodedApiKey)
.build(false) // ์ถ”๊ฐ€ ์ธ์ฝ”๋”ฉ ๋ฐฉ์ง€
.queryParam("apiKey", apiKey)
.build()
.toUriString();

/// ๊ฐ’ ํ˜ธ์ถœ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,18 @@ private String extractMetroCityName(String cityName) {
* "๊ฒฝ๊ธฐ๋„" โ†’ "๊ฒฝ๊ธฐ"
* "์ถฉ์ฒญ๋ถ๋„" โ†’ "์ถฉ๋ถ"
* "๊ฒฝ์ƒ๋‚จ๋„" โ†’ "๊ฒฝ๋‚จ"
* "์ œ์ฃผํŠน๋ณ„์ž์น˜๋„" โ†’ "์ œ์ฃผ"
*/
private String shortenProvinceName(String province) {
if (province == null || province.isBlank()) {
return "";
}

// "ํŠน๋ณ„์ž์น˜๋„" ์ œ๊ฑฐ (์ œ์ฃผ)
if (province.endsWith("ํŠน๋ณ„์ž์น˜๋„")) {
return province.substring(0, province.length() - 5);
}

// "๋„" ์ œ๊ฑฐ
if (province.endsWith("๋„")) {
String base = province.substring(0, province.length() - 1);
Expand Down
Loading