Skip to content

Commit

Permalink
chore: API query param 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongho1209 committed Jun 3, 2024
1 parent 55cd2b1 commit bd369c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class ReviewService(

suspend fun getReviewsByTravelDestinationId(
travelDestinationId: Long,
type: String,
pageable: Pageable,
): ReviewListResponse {
val user = securityFacade.getCurrentUser()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit bd369c6

Please sign in to comment.