-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
934bd38
commit 3dd9d77
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/trip/safe/common/webclient/dto/response/CountrySafetyInfoList.kt
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,14 @@ | ||
package com.trip.safe.common.webclient.dto.response | ||
|
||
data class CountrySafetyInfoList( | ||
val countrySafetyInfoList: List<CountrySafetyInfoElement>, | ||
) | ||
|
||
data class CountrySafetyInfoElement( | ||
val content: String, | ||
val countryEnName: String, | ||
val countryName: String, | ||
val id: String, | ||
val title: String, | ||
val wrtDt: String, | ||
) |
22 changes: 22 additions & 0 deletions
22
src/main/kotlin/com/trip/safe/safeinfo/presentation/SafeInfoController.kt
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,22 @@ | ||
package com.trip.safe.safeinfo.presentation | ||
|
||
import com.trip.safe.common.webclient.dto.response.CountrySafetyInfoElement | ||
import com.trip.safe.safeinfo.service.SafeInfoService | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RequestParam | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
@RequestMapping("/safeInfo") | ||
@RestController | ||
class SafeInfoController( | ||
private val safeInfoService: SafeInfoService, | ||
) { | ||
|
||
@GetMapping | ||
suspend fun getCountrySafetyInfo( | ||
@RequestParam("searchId") searchId: String | ||
): CountrySafetyInfoElement { | ||
return safeInfoService.getCountrySafetyInfo(searchId) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/com/trip/safe/safeinfo/service/SafeInfoService.kt
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,17 @@ | ||
package com.trip.safe.safeinfo.service | ||
|
||
import com.trip.safe.common.webclient.client.CountrySafetyWebClient | ||
import com.trip.safe.common.webclient.dto.response.CountrySafetyInfoElement | ||
import com.trip.safe.safeinfo.domain.CountrySafeInfoRepository | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class SafeInfoService( | ||
private val countrySafeInfoRepository: CountrySafeInfoRepository, | ||
private val countrySafetyWebClient: CountrySafetyWebClient, | ||
) { | ||
|
||
suspend fun getCountrySafetyInfo(searchId: String): CountrySafetyInfoElement { | ||
return countrySafetyWebClient.getCountrySafetyInfo(searchId) | ||
} | ||
} |