memberId가 특정 번호일 때 currency와 관계없이 모든 구매 가능한 캔이 출력되도록 수정

This commit is contained in:
2026-01-16 11:24:48 +09:00
parent ed2660adc6
commit 482241f734
3 changed files with 22 additions and 12 deletions

View File

@@ -14,8 +14,11 @@ import org.springframework.web.bind.annotation.RestController
@RequestMapping("/can")
class CanController(private val service: CanService) {
@GetMapping
fun getCans(): ApiResponse<List<CanResponse>> {
return ApiResponse.ok(service.getCans())
fun getCans(
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
): ApiResponse<List<CanResponse>> {
val isNotSelectedCurrency = member != null && member.id == 2L
return ApiResponse.ok(service.getCans(isNotSelectedCurrency = isNotSelectedCurrency))
}
@GetMapping("/status")