From bd369c67bc89fbee421150370a6b021cf19beb8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A0=95=ED=98=B8?= Date: Mon, 3 Jun 2024 12:16:47 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20API=20query=20param=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/trip/safe/review/presentation/ReviewController.kt | 6 +----- .../kotlin/com/trip/safe/review/service/ReviewService.kt | 1 - .../com/trip/safe/safeinfo/service/SafeInfoService.kt | 7 +++++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/com/trip/safe/review/presentation/ReviewController.kt b/src/main/kotlin/com/trip/safe/review/presentation/ReviewController.kt index 68d7ef8..db729fd 100644 --- a/src/main/kotlin/com/trip/safe/review/presentation/ReviewController.kt +++ b/src/main/kotlin/com/trip/safe/review/presentation/ReviewController.kt @@ -1,6 +1,5 @@ package com.trip.safe.review.presentation -import com.trip.safe.review.domain.Review import com.trip.safe.review.domain.ReviewRepository import com.trip.safe.review.presentation.dto.request.CreateReviewRequest import com.trip.safe.review.presentation.dto.request.UpdateReviewRequest @@ -16,10 +15,8 @@ import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController -import java.time.LocalDate @RequestMapping("/review") @RestController @@ -55,10 +52,9 @@ class ReviewController( @GetMapping("/{travel-destination-id}") suspend fun getReviewsByTravelDestinationId( @PathVariable("travel-destination-id") travelDestinationId: Long, - @RequestParam("type") type: String, pageable: Pageable, ): ReviewListResponse { - return reviewService.getReviewsByTravelDestinationId(travelDestinationId, type, pageable) + return reviewService.getReviewsByTravelDestinationId(travelDestinationId, pageable) } // @GetMapping("/save") diff --git a/src/main/kotlin/com/trip/safe/review/service/ReviewService.kt b/src/main/kotlin/com/trip/safe/review/service/ReviewService.kt index 8d9fbca..3496f7e 100644 --- a/src/main/kotlin/com/trip/safe/review/service/ReviewService.kt +++ b/src/main/kotlin/com/trip/safe/review/service/ReviewService.kt @@ -81,7 +81,6 @@ class ReviewService( suspend fun getReviewsByTravelDestinationId( travelDestinationId: Long, - type: String, pageable: Pageable, ): ReviewListResponse { val user = securityFacade.getCurrentUser() diff --git a/src/main/kotlin/com/trip/safe/safeinfo/service/SafeInfoService.kt b/src/main/kotlin/com/trip/safe/safeinfo/service/SafeInfoService.kt index cba5ee0..fc72b81 100644 --- a/src/main/kotlin/com/trip/safe/safeinfo/service/SafeInfoService.kt +++ b/src/main/kotlin/com/trip/safe/safeinfo/service/SafeInfoService.kt @@ -32,6 +32,9 @@ class SafeInfoService( } val countrySafetyInfo = countrySafetyWebClient.getCountrySafetyInfo(searchId) + + val refinedSafeContent = countrySafetyInfo.content.replace("r' |&|"|<|>|\\s+", "") + val newTravelDestination = travelDestinationRepository.save( TravelDestination( name = countrySafetyInfo.engName, @@ -43,14 +46,14 @@ class SafeInfoService( countrySafeInfoRepository.save( CountrySafeInfo( title = countrySafetyInfo.title, - content = countrySafetyInfo.content, + content = refinedSafeContent, createdDate = countrySafetyInfo.createdDate, travelDestinationId = newTravelDestination.id, ) ) return CountrySafetyInfoElement( - content = countrySafetyInfo.content, + content = refinedSafeContent, name = countrySafetyInfo.name, engName = countrySafetyInfo.engName, code = countrySafetyInfo.code,