diff --git a/src/main/java/com/example/bigbrotherbe/domain/member/controller/MemberController.java b/src/main/java/com/example/bigbrotherbe/domain/member/controller/MemberController.java index e8312f1..b3bf0ce 100644 --- a/src/main/java/com/example/bigbrotherbe/domain/member/controller/MemberController.java +++ b/src/main/java/com/example/bigbrotherbe/domain/member/controller/MemberController.java @@ -39,7 +39,7 @@ public interface MemberController { @Operation(summary = "로그인") @PostMapping("/sign-in") - JwtToken signIn(@RequestBody MemberRequest memberRequest); + ResponseEntity>signIn(@RequestBody MemberRequest memberRequest); @PostMapping("/test") @Operation(summary = "test용", description = "현재는 로그인 멤버의 AffiliationRoleLost를 가져오는 값") @@ -51,15 +51,15 @@ public interface MemberController { @GetMapping("/sign-up/emails/verification") @Operation(summary = "이메일 중복확인") - ResponseEntity verificateEmail(@RequestParam(name = "member-email") String email); + ResponseEntity> verificateEmail(@RequestParam(name = "member-email") String email); @PostMapping("/sign-up/emails/request-code") @Operation(summary = "이메일 인증 코드 요청") - ResponseEntity sendMessage(@RequestBody EmailRequest emailRequest); + ResponseEntity> sendMessage(@RequestBody EmailRequest emailRequest); @GetMapping("/sign-up/emails/verifications") @Operation(summary = "이메일 인증 코드 검증") - ResponseEntity verificationEmail(@RequestParam(name = "email") String email, @RequestParam(name = "code") String code); + ResponseEntity> verificationEmail(@RequestParam(name = "email") String email, @RequestParam(name = "code") String code); @PatchMapping() @Operation(summary = "비밀번호 변경") diff --git a/src/main/java/com/example/bigbrotherbe/domain/member/controller/MemberControllerImpl.java b/src/main/java/com/example/bigbrotherbe/domain/member/controller/MemberControllerImpl.java index 45921e3..7ed4d4e 100644 --- a/src/main/java/com/example/bigbrotherbe/domain/member/controller/MemberControllerImpl.java +++ b/src/main/java/com/example/bigbrotherbe/domain/member/controller/MemberControllerImpl.java @@ -36,7 +36,7 @@ public ResponseEntity> signUp( SignUpDto signUpDto) return ResponseEntity.ok(ApiResponse.success(SUCCESS, memberResponse)); } - public JwtToken signIn(MemberRequest memberRequest) { + public ResponseEntity> signIn(MemberRequest memberRequest) { String memberEmail = memberRequest.getMemberEmail(); String password = memberRequest.getMemberPass(); // 컨트롤러가 없어도 굴러가게 만들어야 하는 데 그러면 Request 객체를 그대로 넘겨주나? @@ -44,7 +44,7 @@ public JwtToken signIn(MemberRequest memberRequest) { log.info("request memberEmail = {}, password = {}", memberEmail, password); log.info("jwtToken accessToken = {}, refreshToken = {}", jwtToken.getAccessToken(), jwtToken.getRefreshToken()); - return jwtToken; + return ResponseEntity.ok(ApiResponse.success(SUCCESS, jwtToken)) ; } @@ -57,18 +57,18 @@ public ResponseEntity> inquireMemberInfo() { return ResponseEntity.ok(ApiResponse.success(SUCCESS,memberService.inquireMemberInfo())); } - public ResponseEntity verificateEmail(String email) { - return ResponseEntity.ok(memberService.verificateEmail(email)); + public ResponseEntity> verificateEmail(String email) { + return ResponseEntity.ok(ApiResponse.success(SUCCESS, memberService.verificateEmail(email))) ; } - public ResponseEntity sendMessage(EmailRequest emailRequest) { + public ResponseEntity> sendMessage(EmailRequest emailRequest) { memberService.sendCodeToEmail(emailRequest.getEmail()); - return ResponseEntity.ok(EmailVerificationResult.builder().authResult(true).build()); + return ResponseEntity.ok(ApiResponse.success(SUCCESS,EmailVerificationResult.builder().authResult(true).build())); } - public ResponseEntity verificationEmail(String email, String code) { - return ResponseEntity.ok(memberService.verifiedCode(email, code)); + public ResponseEntity> verificationEmail(String email, String code) { + return ResponseEntity.ok(ApiResponse.success(SUCCESS,memberService.verifiedCode(email, code))); }