66import fitfit .domain .member .dto .MemberResponseDTO ;
77import fitfit .domain .member .entity .Member ;
88import fitfit .domain .member .service .MemberCommandService ;
9- import fitfit .domain .token .service .MemberTokenCommandUseCase ;
9+ import fitfit .domain .member .service .MemberQueryService ;
10+ import fitfit .domain .token .service .MemberTokenCommandService ;
1011import fitfit .global .apiPayload .ApiResponse ;
12+ import fitfit .global .apiPayload .code .status .SuccessStatus ;
1113import fitfit .global .enums .Provider ;
1214import io .swagger .v3 .oas .annotations .Operation ;
13- import io .swagger .v3 .oas .annotations .tags .Tag ;
1415import io .swagger .v3 .oas .annotations .media .Content ;
1516import io .swagger .v3 .oas .annotations .media .Schema ;
1617import io .swagger .v3 .oas .annotations .responses .ApiResponses ;
18+ import io .swagger .v3 .oas .annotations .tags .Tag ;
1719import jakarta .validation .Valid ;
1820import lombok .RequiredArgsConstructor ;
1921import lombok .extern .slf4j .Slf4j ;
2729public class MemberRestController {
2830
2931 private final MemberCommandService memberCommandService ;
30- private final MemberTokenCommandUseCase memberTokenService ;
32+ private final MemberTokenCommandService memberTokenService ;
3133 private final KakaoOidcService kakaoOidcService ;
34+ private final MemberQueryService memberQueryService ;
3235
3336 @ PostMapping ("/auth/kko" )
3437 @ Operation (summary = "KAKAO OAuth2 로그인 API" , description = "KAKAO OAuth2 로그인 API 입니다." )
@@ -61,7 +64,7 @@ public ApiResponse<MemberResponseDTO.KkoOAuth2LoginResponse> kkoOAuth2Login (@Va
6164 @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "필수 약관에 동의하지 않았습니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
6265 })
6366 public ApiResponse <MemberResponseDTO .TermAgreementResponse > termAgreement (
64- @ RequestHeader (value = "Authorization" , required = false ) String authorization ,
67+ @ RequestHeader (value = "Authorization" , required = true ) String authorization ,
6568 @ Valid @ RequestBody MemberRequestDTO .TermAgreementRequest request ) {
6669 return ApiResponse .onSuccess (memberCommandService .termAgreement (authorization , request ));
6770 }
@@ -77,11 +80,119 @@ public ApiResponse<MemberResponseDTO.TermAgreementResponse> termAgreement(
7780 @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "회원 필수 정보가 누락되었습니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
7881 })
7982 public ApiResponse <MemberResponseDTO .MemberSignupResponse > signup (
80- @ RequestHeader (value = "Authorization" , required = false ) String authorization ,
83+ @ RequestHeader (value = "Authorization" , required = true ) String authorization ,
8184 @ Valid @ RequestBody MemberRequestDTO .MemberSignupRequest request ) {
8285 return ApiResponse .onSuccess (memberCommandService .memberSignup (authorization , request ));
8386 }
8487
88+ @ GetMapping ("/mypage" )
89+ @ Operation (summary = "마이페이지 첫 화면 프로필 조회" , description = "헤더의 토큰을 사용해 닉네임, 프사, 이메일, 클린지수 등을 조회하는 API입니다." )
90+ @ ApiResponses ({
91+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "200" , description = "OK, 성공" ),
92+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "유효하지 않은 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
93+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "만료된 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
94+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "404" , description = "존재하지 않는 회원입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
95+ })
96+ public ApiResponse <MemberResponseDTO .MyProfileResDTO > getMyPage (
97+ @ RequestHeader (value ="Authorization" , required = true ) String authorization
98+ ){
99+ MemberResponseDTO .MyProfileResDTO result = memberQueryService .getMyProfile (authorization );
100+ return ApiResponse .of (SuccessStatus ._OK , result );
101+
102+ }
103+
104+ @ GetMapping ("/mypage/detail" )
105+ @ Operation (summary ="프로필 상세 정보 조회(프로필 관리 페이지)" , description = "프로필 관리 화면에 진입할 때, 기본 정보를 조회하는 API(체형 정보 제외)" )
106+ @ ApiResponses ({
107+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "200" , description = "OK, 성공" ),
108+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "유효하지 않은 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
109+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "만료된 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
110+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "404" , description = "존재하지 않는 회원입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
111+ })
112+ public ApiResponse <MemberResponseDTO .MyProfileDetailDto > getMyProfileDetail (
113+ @ RequestHeader (value ="Authorization" , required = true ) String authorization
114+
115+ ){
116+ return ApiResponse .of (SuccessStatus ._OK , memberQueryService .getMyProfileDetail (authorization ));
117+ }
118+
119+ @ PatchMapping ("/mypage/detail" )
120+ @ Operation (summary = "프로필 정보 수정" , description = "프로필 사진 URL과 텍스트 정보를 수정하는 API" )
121+ @ ApiResponses ({
122+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "200" , description = "OK, 성공" ),
123+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "Bad Request, 잘못된 요청 형식" , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
124+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "유효하지 않은 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
125+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "만료된 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
126+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "404" , description = "존재하지 않는 회원입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
127+ })
128+ public ApiResponse <MemberResponseDTO .MyProfileDetailDto > updateMyProfile (
129+ @ RequestHeader (value ="Authorization" , required = true ) String authorization ,
130+ @ RequestBody @ Valid MemberRequestDTO .UpdateProfileDTO req
131+ ) {
132+
133+ return ApiResponse .of (SuccessStatus ._OK , memberCommandService .updateProfile (authorization ,req ));
134+ }
135+
136+ @ GetMapping ("/mypage/body-info" )
137+ @ Operation (summary = "체형 정보 조회" , description = "프로필 관리하기 -> 체형정보 수정하기에서 키, 몸무게, 전신사진URL을 조회하는 API" )
138+ @ ApiResponses ({
139+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "200" , description = "OK, 성공" ),
140+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "유효하지 않은 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
141+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "만료된 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
142+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "404" , description = "존재하지 않는 회원입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
143+ })
144+ public ApiResponse <MemberResponseDTO .BodyInfoResDTO > getBodyInfo (
145+ @ RequestHeader (value ="Authorization" , required = true ) String authorization
146+ ){
147+ return ApiResponse .of (SuccessStatus ._OK ,memberQueryService .getBodyInfo (authorization ));
148+ }
149+
150+ @ PatchMapping ("/mypage/body-info" )
151+ @ Operation (summary = "체형 정보 수정" , description = "키, 몸무게, 전신사진URL을 수정하는 API" )
152+ @ ApiResponses ({
153+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "200" , description = "OK, 성공" ),
154+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "Bad Request, 잘못된 요청 형식" , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
155+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "유효하지 않은 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
156+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "만료된 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
157+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "404" , description = "존재하지 않는 회원입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
158+ })
159+ public ApiResponse <MemberResponseDTO .BodyInfoResDTO > updateBodyInfo (
160+ @ RequestHeader (value ="Authorization" , required = true ) String authorization ,
161+ @ RequestBody @ Valid MemberRequestDTO .UpdateBodyInfoReqDTO req
162+ ){
163+ return ApiResponse .of (SuccessStatus ._OK ,memberCommandService .updateBodyInfo (authorization ,req ));
164+ }
165+
166+ @ GetMapping ("/leaf" )
167+ @ Operation (summary = "나의 나뭇잎 조회" , description = "현재 보유한 나뭇잎(포인트)를 조회하는 API" )
168+ @ ApiResponses ({
169+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "200" , description = "OK, 성공" ),
170+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "유효하지 않은 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
171+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "만료된 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
172+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "404" , description = "존재하지 않는 회원입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
173+ })
174+ public ApiResponse <MemberResponseDTO .PointResDTO > getMyPoing (
175+ @ RequestHeader (value ="Authorization" , required = true ) String authorization
176+ ){
177+ return ApiResponse .of (SuccessStatus ._OK ,memberQueryService .getMyPoint (authorization ));
178+ }
179+
180+ @ PostMapping ("/leaf/quiz" )
181+ @ Operation (summary = "퀴즈 결과 나뭇잎 적립" , description = "맞춘 문제 개수를 받아 나뭇잎을 적립하는 API (1문제당 50잎)" )
182+ @ ApiResponses ({
183+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "200" , description = "OK, 성공" ),
184+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "Bad Request, 잘못된 요청 형식" , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
185+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "유효하지 않은 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
186+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "400" , description = "만료된 JWT 토큰입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
187+ @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "404" , description = "존재하지 않는 회원입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
188+ })
189+ public ApiResponse <MemberResponseDTO .QuizPointResDTO > earnQuizPoint (
190+ @ RequestHeader (value ="Authorization" , required = true ) String authorization ,
191+ @ RequestBody @ Valid MemberRequestDTO .QuizPointReqDTO req
192+ ){
193+ return ApiResponse .of (SuccessStatus ._OK ,memberCommandService .earnQuizPoint (authorization ,req ));
194+ }
195+
85196 @ PostMapping ("/nickname/check" )
86197 @ Operation (summary = "닉네임 중복 확인 API" , description = "닉네임 중복을 확인하는 API입니다." )
87198 @ ApiResponses ({
@@ -101,7 +212,7 @@ public ApiResponse<String> checkNickname(@Valid @RequestBody MemberRequestDTO.Ni
101212 @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "401" , description = "인증이 필요합니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class ))),
102213 @ io .swagger .v3 .oas .annotations .responses .ApiResponse (responseCode = "404" , description = "존재하지 않는 회원입니다." , content = @ Content (schema = @ Schema (implementation = ApiResponse .class )))
103214 })
104- public ApiResponse <String > withdrawMember (@ RequestHeader ("Authorization" ) String authorization ) {
215+ public ApiResponse <String > withdrawMember (@ RequestHeader (value = "Authorization" , required = true ) String authorization ) {
105216 memberCommandService .withdrawMember (authorization );
106217 return ApiResponse .onSuccess ("회원 탈퇴가 성공적으로 처리되었습니다." );
107218 }
0 commit comments