|
13 | 13 | import jakarta.validation.Valid; |
14 | 14 | import org.springframework.http.ResponseEntity; |
15 | 15 | import org.springframework.web.bind.annotation.GetMapping; |
| 16 | +import org.springframework.web.bind.annotation.PostMapping; |
16 | 17 | import org.springframework.web.bind.annotation.RequestBody; |
17 | 18 | import org.springframework.web.bind.annotation.RequestParam; |
18 | 19 |
|
@@ -690,4 +691,75 @@ ResponseEntity<RsData<Map<String, String>>> refreshToken( |
690 | 691 | HttpServletRequest request, |
691 | 692 | HttpServletResponse response |
692 | 693 | ); |
| 694 | + |
| 695 | + @Operation( |
| 696 | + summary = "아이디 찾기", |
| 697 | + description = "사용자가 이메일을 입력하면, 해당 이메일로 가입된 계정의 아이디(username)를 일부 마스킹 처리하여 이메일로 전송합니다." |
| 698 | + ) |
| 699 | + @ApiResponses({ |
| 700 | + @ApiResponse( |
| 701 | + responseCode = "200", |
| 702 | + description = "아이디 찾기 성공", |
| 703 | + content = @Content( |
| 704 | + mediaType = "application/json", |
| 705 | + examples = @ExampleObject(value = """ |
| 706 | + { |
| 707 | + "success": true, |
| 708 | + "code": "SUCCESS_200", |
| 709 | + "message": "아이디를 이메일로 전송했습니다.", |
| 710 | + "data": null |
| 711 | + } |
| 712 | + """) |
| 713 | + ) |
| 714 | + ), |
| 715 | + @ApiResponse( |
| 716 | + responseCode = "404", |
| 717 | + description = "존재하지 않는 사용자", |
| 718 | + content = @Content( |
| 719 | + mediaType = "application/json", |
| 720 | + examples = @ExampleObject(value = """ |
| 721 | + { |
| 722 | + "success": false, |
| 723 | + "code": "USER_001", |
| 724 | + "message": "존재하지 않는 사용자입니다.", |
| 725 | + "data": null |
| 726 | + } |
| 727 | + """) |
| 728 | + ) |
| 729 | + ), |
| 730 | + @ApiResponse( |
| 731 | + responseCode = "400", |
| 732 | + description = "잘못된 요청 (이메일 누락 등)", |
| 733 | + content = @Content( |
| 734 | + mediaType = "application/json", |
| 735 | + examples = @ExampleObject(value = """ |
| 736 | + { |
| 737 | + "success": false, |
| 738 | + "code": "COMMON_400", |
| 739 | + "message": "잘못된 요청입니다.", |
| 740 | + "data": null |
| 741 | + } |
| 742 | + """) |
| 743 | + ) |
| 744 | + ), |
| 745 | + @ApiResponse( |
| 746 | + responseCode = "500", |
| 747 | + description = "서버 내부 오류", |
| 748 | + content = @Content( |
| 749 | + mediaType = "application/json", |
| 750 | + examples = @ExampleObject(value = """ |
| 751 | + { |
| 752 | + "success": false, |
| 753 | + "code": "COMMON_500", |
| 754 | + "message": "서버 오류가 발생했습니다.", |
| 755 | + "data": null |
| 756 | + } |
| 757 | + """) |
| 758 | + ) |
| 759 | + ) |
| 760 | + }) |
| 761 | + @PostMapping("/username/recover") |
| 762 | + ResponseEntity<RsData<Void>> recoverUsername( |
| 763 | + @Valid @RequestBody sendEmailRequest request |
| 764 | + ); |
693 | 765 | } |
0 commit comments