-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] Naver Maps Api 연동 완료 + Path API 테스트 완료
- Loading branch information
1 parent
a46fe83
commit 6ae7dc0
Showing
10 changed files
with
113 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d/domain/member/SwaggerConfiguration.java → .../backend/domain/SwaggerConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
backend/src/main/java/com/twtw/backend/domain/path/controller/PathController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.twtw.backend.domain.path.controller; | ||
|
||
import com.twtw.backend.domain.path.dto.client.SearchPathRequest; | ||
import com.twtw.backend.domain.path.service.PathService; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RestController | ||
@RequestMapping("/paths") | ||
public class PathController { | ||
private final PathService pathService; | ||
|
||
public PathController(PathService pathService){ | ||
this.pathService = pathService; | ||
} | ||
|
||
/*response 변경*/ | ||
@PostMapping("/search/path") | ||
String searchPath(@RequestBody SearchPathRequest request){ | ||
return pathService.searchPath(request); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
backend/src/main/java/com/twtw/backend/domain/path/dto/client/SearchPathFuel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.twtw.backend.domain.path.dto.client; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public enum SearchPathFuel { | ||
GASOLINE("gasoline"), | ||
HIGHGRADEGASOLINE("highgradegasoline"), | ||
DIESEL("diesel"), | ||
LPG("lpg"); | ||
|
||
private final String toSmall; | ||
} |
19 changes: 19 additions & 0 deletions
19
backend/src/main/java/com/twtw/backend/domain/path/dto/client/SearchPathOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.twtw.backend.domain.path.dto.client; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public enum SearchPathOption { | ||
TRAFAST("실시간 빠른길","trafast"), | ||
TRACOMFORT("실시간 편한길","tracomfort"), | ||
TRAOPTIONAL("실시간 최적","traoptional"), | ||
TRAAVOIDTOLL("무료 우선","travoidtoll"), | ||
TRAAVOIDCARONLY("자동차 전용도로 회피 우선","traavoidcaronly"); | ||
|
||
private final String toKorean; | ||
private final String toSmall; | ||
|
||
public String toSmallOption(){ | ||
return this.toSmall; | ||
} | ||
} |
13 changes: 12 additions & 1 deletion
13
backend/src/main/java/com/twtw/backend/domain/path/dto/client/SearchPathRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
package com.twtw.backend.domain.path.dto.client; | ||
|
||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
|
||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class SearchPathRequest { | ||
|
||
String start; | ||
String end; | ||
String wayPoint; | ||
@Enumerated(value = EnumType.STRING) | ||
SearchPathOption option; | ||
String carType; | ||
@Enumerated(value = EnumType.STRING) | ||
SearchPathFuel fuelType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
backend/src/main/java/com/twtw/backend/domain/path/service/PathService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
package com.twtw.backend.domain.path.service; | ||
|
||
import com.twtw.backend.domain.path.dto.client.SearchPathRequest; | ||
import com.twtw.backend.domain.path.dto.client.SearchPathResponse; | ||
import com.twtw.backend.global.client.PathClient; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class PathService { | ||
private final PathClient<SearchPathRequest, SearchPathResponse> client; | ||
|
||
PathService(PathClient<SearchPathRequest, SearchPathResponse> client){ | ||
this.client = client; | ||
} | ||
|
||
public String searchPath(final SearchPathRequest request){ | ||
return this.client.request(request); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
backend/src/main/java/com/twtw/backend/global/client/PathClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.twtw.backend.global.client; | ||
|
||
public interface PathClient<T, R>{ | ||
|
||
public String request(T request); | ||
} |