diff --git a/photo-service/src/main/java/kr/mafoo/photo/api/RecapApi.java b/photo-service/src/main/java/kr/mafoo/photo/api/RecapApi.java index a418448..70326e5 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/api/RecapApi.java +++ b/photo-service/src/main/java/kr/mafoo/photo/api/RecapApi.java @@ -7,6 +7,7 @@ import kr.mafoo.photo.annotation.RequestMemberId; import kr.mafoo.photo.controller.dto.request.RecapCreateRequest; import kr.mafoo.photo.controller.dto.response.RecapResponse; +import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Mono; @@ -29,8 +30,7 @@ Mono createRecap( @RequestParam(required = false) String sort, - @RequestHeader("Authorization") - String authorizationToken + ServerHttpRequest serverHttpRequest ); } diff --git a/photo-service/src/main/java/kr/mafoo/photo/controller/RecapController.java b/photo-service/src/main/java/kr/mafoo/photo/controller/RecapController.java index aec3718..19f1866 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/controller/RecapController.java +++ b/photo-service/src/main/java/kr/mafoo/photo/controller/RecapController.java @@ -5,6 +5,7 @@ import kr.mafoo.photo.controller.dto.response.RecapResponse; import kr.mafoo.photo.service.RecapService; import lombok.RequiredArgsConstructor; +import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.web.bind.annotation.RestController; import reactor.core.publisher.Mono; @@ -19,8 +20,10 @@ public Mono createRecap( String memberId, RecapCreateRequest request, String sort, - String authorizationToken + ServerHttpRequest serverHttpRequest ) { + String authorizationToken = serverHttpRequest.getHeaders().getFirst("Authorization"); + return recapService.createRecap(request.albumId(), memberId, sort, authorizationToken) .map(RecapResponse::fromString); }