66import com .weve .dto .response .*;
77import com .weve .service .AnswerService ;
88import com .weve .service .WorryService ;
9+ import io .swagger .v3 .oas .annotations .Operation ;
10+ import io .swagger .v3 .oas .annotations .tags .Tag ;
911import jakarta .validation .Valid ;
1012import lombok .RequiredArgsConstructor ;
1113import lombok .extern .slf4j .Slf4j ;
1921@ Validated
2022@ Slf4j
2123@ RequestMapping ("/api/worries" )
24+ @ Tag (name = "Worry" , description = "Worry 관련 API입니다." )
2225public class WorryController {
2326
2427 private final WorryService worryService ;
@@ -28,6 +31,7 @@ public class WorryController {
2831 * 고민 작성하기
2932 */
3033 @ PostMapping
34+ @ Operation (summary = "고민 작성하기" , description = "고민을 작성합니다." )
3135 public BasicResponse <CreateWorryResponse > createWorry (@ AuthenticationPrincipal UserDetails userDetails ,
3236 @ RequestBody @ Valid CreateWorryRequest request ) {
3337
@@ -41,6 +45,7 @@ public BasicResponse<CreateWorryResponse> createWorry(@AuthenticationPrincipal U
4145 * 고민 목록 조회(JUNIOR ver)
4246 */
4347 @ GetMapping ("/junior" )
48+ @ Operation (summary = "고민 목록 조회(JUNIOR ver)" , description = "고민 목록을 조회합니다.(JUNIOR ver)" )
4449 public BasicResponse <GetWorriesResponse .JuniorVer > getWorriesForJunior (@ AuthenticationPrincipal UserDetails userDetails ) {
4550 String username = userDetails .getUsername ();
4651 GetWorriesResponse .JuniorVer response = worryService .getWorriesForJunior (username );
@@ -51,6 +56,7 @@ public BasicResponse<GetWorriesResponse.JuniorVer> getWorriesForJunior(@Authenti
5156 * 고민 목록 조회(SENIOR ver)
5257 */
5358 @ GetMapping ("/senior" )
59+ @ Operation (summary = "고민 목록 조회(SENIOR ver)" , description = "고민 목록을 조회합니다.(SENIOR ver)" )
5460 public BasicResponse <GetWorriesResponse .SeniorVer > getWorriesForSenior (@ AuthenticationPrincipal UserDetails userDetails ) {
5561 String username = userDetails .getUsername ();
5662 GetWorriesResponse .SeniorVer response = worryService .getWorriesForSenior (username );
@@ -61,6 +67,7 @@ public BasicResponse<GetWorriesResponse.SeniorVer> getWorriesForSenior(@Authenti
6167 * 고민 상세 조회(JUNIOR ver)
6268 */
6369 @ GetMapping ("/{worryId}/junior" )
70+ @ Operation (summary = "고민 상세 조회(JUNIOR ver)" , description = "고민을 상세 조회합니다.(JUNIOR ver)" )
6471 public BasicResponse <GetWorryResponse .JuniorVer > getWorryForJunior (@ AuthenticationPrincipal UserDetails userDetails ,
6572 @ PathVariable Long worryId ) {
6673 String username = userDetails .getUsername ();
@@ -72,6 +79,7 @@ public BasicResponse<GetWorryResponse.JuniorVer> getWorryForJunior(@Authenticati
7279 * 고민 상세 조회(SENIOR ver)
7380 */
7481 @ GetMapping ("/{worryId}/senior" )
82+ @ Operation (summary = "고민 상세 조회(SENIOR ver)" , description = "고민을 상세 조회합니다.(SENIOR ver)" )
7583 public BasicResponse <GetWorryResponse .SeniorVer > getWorryForSenior (@ AuthenticationPrincipal UserDetails userDetails ,
7684 @ PathVariable Long worryId ) {
7785 String username = userDetails .getUsername ();
@@ -83,6 +91,7 @@ public BasicResponse<GetWorryResponse.SeniorVer> getWorryForSenior(@Authenticati
8391 * 답변 작성하기
8492 */
8593 @ PostMapping ("/{worryId}/answer" )
94+ @ Operation (summary = "답변 작성하기" , description = "답변을 작성합니다." )
8695 public BasicResponse <?> createAnswer (@ AuthenticationPrincipal UserDetails userDetails ,
8796 @ PathVariable Long worryId ,
8897 @ RequestBody @ Valid CreateAnswerRequest request ) {
@@ -97,6 +106,7 @@ public BasicResponse<?> createAnswer(@AuthenticationPrincipal UserDetails userDe
97106 * 답변 상세 조회(JUNIOR ver)
98107 */
99108 @ GetMapping ("/{worryId}/answer/junior" )
109+ @ Operation (summary = "답변 상세 조회(JUNIOR ver)" , description = "답변을 상세 조회합니다.(JUNIOR ver)" )
100110 public BasicResponse <GetAnswerResponse .JuniorVer > getAnswerForJunior (@ AuthenticationPrincipal UserDetails userDetails ,
101111 @ PathVariable Long worryId ) {
102112 String username = userDetails .getUsername ();
@@ -108,6 +118,7 @@ public BasicResponse<GetAnswerResponse.JuniorVer> getAnswerForJunior(@Authentica
108118 * 답변 상세 조회(SENIOR ver)
109119 */
110120 @ GetMapping ("/{worryId}/answer/senior" )
121+ @ Operation (summary = "답변 상세 조회(SENIOR ver)" , description = "답변을 상세 조회합니다.(SENIOR ver)" )
111122 public BasicResponse <GetAnswerResponse .SeniorVer > getAnswerForSenior (@ AuthenticationPrincipal UserDetails userDetails ,
112123 @ PathVariable Long worryId ) {
113124 String username = userDetails .getUsername ();
@@ -119,6 +130,7 @@ public BasicResponse<GetAnswerResponse.SeniorVer> getAnswerForSenior(@Authentica
119130 * 감사편지 상세 조회(JUNIOR ver)
120131 */
121132 @ GetMapping ("/{worryId}/appreciate/junior" )
133+ @ Operation (summary = "감사편지 상세 조회(JUNIOR ver)" , description = "감사편지를 상세 조회합니다.(JUNIOR ver)" )
122134 public BasicResponse <GetAppreciateResponse .JuniorVer > getAppreciateForJunior (@ AuthenticationPrincipal UserDetails userDetails ,
123135 @ PathVariable Long worryId ) {
124136 String username = userDetails .getUsername ();
0 commit comments