diff --git a/src/main/java/com/api/trip/domain/member/controller/MemberController.java b/src/main/java/com/api/trip/domain/member/controller/MemberController.java index 7ba2243..8ddff53 100644 --- a/src/main/java/com/api/trip/domain/member/controller/MemberController.java +++ b/src/main/java/com/api/trip/domain/member/controller/MemberController.java @@ -9,20 +9,16 @@ import com.api.trip.domain.member.service.MemberService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.tags.Tags; import jakarta.servlet.http.HttpServletRequest; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; import java.io.IOException; -import java.util.List; @Tag(name = "members", description = "회원 API") @RestController @@ -33,6 +29,7 @@ public class MemberController { private final MemberService memberService; private final EmailService emailService; + @Operation(summary = "회원 가입", description = "이메일, 비밀번호, 닉네임, [프로필 이미지]를 입력해서 회원가입을 한다.") @PostMapping(value = "/join") public ResponseEntity join(@ModelAttribute @Valid JoinRequest joinRequest) throws IOException { @@ -40,12 +37,14 @@ public ResponseEntity join(@ModelAttribute @Valid JoinRequest joinRequest) return ResponseEntity.ok().build(); } + @Operation(summary = "로그인", description = "이메일, 비밀번호를 입력해서 로그인한다.") @PostMapping("/login") public ResponseEntity login(@RequestBody @Valid LoginRequest loginRequest) { LoginResponse loginResponse = memberService.login(loginRequest); return ResponseEntity.ok().body(loginResponse); } + @Operation(summary = "마이페이지", description = "마이페이지 화면으로 이동한다.") @GetMapping("/me") public ResponseEntity myPage() { MyPageResponse myPageResponse = memberService.myPage(); @@ -54,12 +53,14 @@ public ResponseEntity myPage() { // 인증 메일 전송 + @Operation(summary = "인증 메일 전송", description = "인증 링크를 포함한 메일을 발송한다.") @PostMapping("/send-email/{email}") public void sendAuthEmail(@PathVariable String email) { emailService.send(email, emailService.createEmailAuth(email)); } // 이메일 인증 + @Operation(summary = "이메일 인증", description = "인증 메일이 유효한지 검사하고 인증을 처리한다.") @GetMapping("/auth-email/{email}/{authToken}") public ResponseEntity emailAndAuthToken(@PathVariable String email, @PathVariable String authToken) { EmailResponse emailResponse = emailService.authEmail(email, authToken); @@ -71,6 +72,7 @@ public ResponseEntity emailAndAuthToken(@PathVariable String emai return ResponseEntity.ok().headers(headers).body(emailResponse); } + @Operation(summary = "비밀번호 찾기", description = "임시 비밀번호를 발급한다.") @PreAuthorize("isAnonymous()") @PostMapping("/find/password") public ResponseEntity sendNewPassword(@RequestBody FindPasswordRequest findPasswordRequest) { @@ -78,6 +80,7 @@ public ResponseEntity sendNewPassword(@RequestBody FindPasswordRequest fin return ResponseEntity.ok().build(); } + @Operation(summary = "프로필 수정", description = "프로필 이미지, 닉네임, 관심 태그를 수정한다.") @PreAuthorize("isAuthenticated()") @PatchMapping("/me") public ResponseEntity updateProfile(@ModelAttribute UpdateProfileRequest updateProfileRequest) throws IOException { @@ -85,6 +88,7 @@ public ResponseEntity updateProfile(@ModelAttribute UpdateProfileRequest u return ResponseEntity.ok().build(); } + @Operation(summary = "비밀번호 변경", description = "현재 비밀번호를 변경한다.") @PreAuthorize("isAuthenticated()") @PatchMapping("/password") public ResponseEntity updatePassword(@RequestBody UpdatePasswordRequest updatePasswordRequest) { @@ -93,6 +97,7 @@ public ResponseEntity updatePassword(@RequestBody UpdatePasswordRequest up } + @Operation(summary = "회원 탈퇴", description = "[일반 회원]의 탈퇴 처리를 진행한다.") @PreAuthorize("isAuthenticated()") @DeleteMapping("/me") public ResponseEntity deleteMember(@RequestBody DeleteRequest deleteRequest) { @@ -100,6 +105,7 @@ public ResponseEntity deleteMember(@RequestBody DeleteRequest deleteReques return ResponseEntity.ok().build(); } + @Operation(summary = "소셜 회원 탈퇴", description = "[소셜 회원]의 탈퇴 처리를 진행한다.") @PreAuthorize("isAuthenticated()") @DeleteMapping("/social/me") public ResponseEntity deleteSocialMember() { @@ -107,14 +113,15 @@ public ResponseEntity deleteSocialMember() { return ResponseEntity.ok().build(); } + @Operation(summary = "로그아웃", description = "현재 계정을 로그아웃 처리한다.") @PreAuthorize("isAuthenticated()") - @Operation(summary = "로그아웃") @PostMapping("/logout") public ResponseEntity logoutMember() { String username = SecurityContextHolder.getContext().getAuthentication().getName(); return ResponseEntity.ok().body(memberService.logout(username)); } + @Operation(summary = "refreshToken 재발급", description = "만료된 refreshToken을 재발급한다.") @GetMapping("/rotate") public JwtToken rotateToken(HttpServletRequest request){ String refreshToken = JwtTokenUtils.extractBearerToken(request.getHeader("refreshToken"));