Skip to content

Commit

Permalink
fix: 초대코드 아이 정보 조회 API JWT filter 경로 예외 추가 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
whereami2048 authored Jan 9, 2025
1 parent c6c1231 commit 921d47e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import kr.co.vacgom.api.invitation.presentation.InvitationApi
import kr.co.vacgom.api.invitation.presentation.InvitationApi.Companion.INVITATION
import kr.co.vacgom.api.user.application.UserTokenService
import kr.co.vacgom.api.user.presentation.AuthApi
import kr.co.vacgom.api.user.presentation.AuthApi.Companion.AUTH
import kr.co.vacgom.api.user.presentation.UserApi
import kr.co.vacgom.api.user.presentation.UserApi.Companion.USER
import org.springframework.http.HttpMethod
import org.springframework.security.core.context.SecurityContextHolder
import org.springframework.stereotype.Component
Expand Down Expand Up @@ -57,10 +59,10 @@ class JwtAuthenticationFilter(
"/v3/api-docs/swagger-config" to HttpMethod.GET,
"/v3/api-docs.yaml" to HttpMethod.GET,
BASE_V3 + BABY + "/images" to HttpMethod.POST,
BASE_V3 + AuthApi.AUTH + "/login/**" to HttpMethod.POST,
BASE_V3 + UserApi.USER to HttpMethod.POST,
BASE_V3 + AUTH + "/login/**" to HttpMethod.POST,
BASE_V3 + USER to HttpMethod.POST,
BASE_V3 + "/**" to HttpMethod.OPTIONS,
BASE_V3 + UserApi.USER + INVITATION to HttpMethod.POST,
BASE_V3 + USER + INVITATION to HttpMethod.POST,
BASE_V3 + INVITATION to HttpMethod.POST,
BASE_V3 + "/TEST/**" to HttpMethod.POST
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class InvitationService(
}

@Transactional
fun getBabiesByInvitationCode(userId: UUID, code: String): List<BabyDto.Response.Detail> {
fun getBabiesByInvitationCode(code: String): List<BabyDto.Response.Detail> {
val invitationCode = invitationRepository.getAndDeleteInvitationCode(code)
?: throw BusinessException(InvitationError.INVITATION_CODE_NOT_FOUND)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ class InvitationController(
}.let { BaseResponse.success(it) }
}

@PostMapping("/get")
@PostMapping
override fun getBabiesByInvitationCode(@RequestBody request: InvitationDto.Request.Get): BaseResponse<List<BabyDto.Response.Detail>> {
val userId = SecurityContextUtil.getPrincipal()

return invitationService.getBabiesByInvitationCode(userId, request.invitationCode)
.let { BaseResponse.success(it) }
return invitationService.getBabiesByInvitationCode(request.invitationCode).let { BaseResponse.success(it) }
}
}

0 comments on commit 921d47e

Please sign in to comment.