Skip to content

Commit

Permalink
🔨 Delete decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
wonseok committed Jan 31, 2025
1 parent d75bf24 commit 3617a62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PutMapping
import org.springframework.web.bind.annotation.RestController
import java.net.URLDecoder

@RestController
class MannerController(
Expand All @@ -16,10 +15,7 @@ class MannerController(
@PathVariable nickname: String,
@PathVariable mannerType: MannerType,
): ResponseEntity<String> {
// Decode the nickname
val decodedNickname = URLDecoder.decode(nickname, "UTF-8")

mannerService.increaseMannerCount(decodedNickname, mannerType)
mannerService.increaseMannerCount(nickname, mannerType)
return ResponseEntity.noContent().build()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.PutMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
import java.net.URLDecoder

@RestController
class ProfileController(
Expand All @@ -38,10 +37,7 @@ class ProfileController(
fun getProfile(
@PathVariable nickname: String,
): ResponseEntity<ProfileResponse> {
// Decode nickname
val decodedNickname = URLDecoder.decode(nickname, "UTF-8")

val profile = profileService.getProfile(decodedNickname)
val profile = profileService.getProfile(nickname)
return ResponseEntity.ok(profile)
}

Expand All @@ -50,10 +46,7 @@ class ProfileController(
@PathVariable nickname: String,
@RequestParam articleId: Long,
): ResponseEntity<List<Item>> {
// Decode nickname
val decodedNickname = URLDecoder.decode(nickname, "UTF-8")

val itemList: List<Item> = profileService.getProfileSells(decodedNickname, articleId)
val itemList: List<Item> = profileService.getProfileSells(nickname, articleId)
return ResponseEntity.ok(itemList)
}

Expand All @@ -70,10 +63,7 @@ class ProfileController(
fun getManners(
@PathVariable nickname: String,
): ResponseEntity<MannersResponse> {
// Decode nickname
val decodedNickname = URLDecoder.decode(nickname, "UTF-8")

val manners = profileService.getManner(decodedNickname)
val manners = profileService.getManner(nickname)
return ResponseEntity.ok(manners)
}

Expand All @@ -82,10 +72,7 @@ class ProfileController(
@PathVariable nickname: String,
@RequestParam("reviewId") reviewId: Long,
): ResponseEntity<ReviewsResponse> {
// Decode nickname
val decodedNickname = URLDecoder.decode(nickname, "UTF-8")

val reviews = profileService.getPreviousReviews(decodedNickname, reviewId)
val reviews = profileService.getPreviousReviews(nickname, reviewId)
return ResponseEntity.ok(reviews)
}
}
Expand Down

0 comments on commit 3617a62

Please sign in to comment.