diff --git a/src/main/java/org/example/gather_back_end/creator/controller/CreatorControllerApi.java b/src/main/java/org/example/gather_back_end/creator/controller/CreatorControllerApi.java index 7c43a39..5fe5506 100644 --- a/src/main/java/org/example/gather_back_end/creator/controller/CreatorControllerApi.java +++ b/src/main/java/org/example/gather_back_end/creator/controller/CreatorControllerApi.java @@ -30,13 +30,16 @@ public interface CreatorControllerApi { @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "크리에이터 등록 완료", content = @Content(mediaType = "application/json", - examples = @ExampleObject(value = "{\n" - + " \"timestamp\": \"2024-11-03T05:07:47.704694\",\n" - + " \"isSuccess\": true,\n" - + " \"code\": \"200\",\n" - + " \"message\": \"호출에 성공하였습니다.\",\n" - + " \"data\": \"null" - + "}"), + examples = @ExampleObject(value = """ + { + "timestamp": "2024-11-03T05:07:47.704694", + "isSuccess": true, + "code": "200", + "message": "호출에 성공하였습니다.", + "data": null + } + """ + ), schema = @Schema(implementation = SuccessResponse.class))) }) @PostMapping @@ -53,13 +56,35 @@ SuccessResponse createCreator( @ApiResponse(responseCode = "200", description = "크리에이터 상세 페이지 조회 nickname = 크리에이터명", content = @Content(mediaType = "application/json", - examples = @ExampleObject(value = "{\n" - + " \"timestamp\": \"2024-11-03T05:07:47.704694\",\n" - + " \"isSuccess\": true,\n" - + " \"code\": \"200\",\n" - + " \"message\": \"호출에 성공하였습니다.\",\n" - + " \"data\": \"null" - + "}"), + examples = @ExampleObject(value = """ + { + "nickname": "USER8543", + "profileImgUrl": "https~~", + "introductionTitle": "내가 최고라서", + "introductionContent": "저한테 맡겨만 주세요", + "getPortfolioResList": [ + { + "title": "제 첫번째 작품입니다.", + "thumbnailImgUrl": "https~", + "fileUrl": "https~" + }, + { + "title": "제 두번째 작품입니다.", + "thumbnailImgUrl": "https~", + "fileUrl": "https~" + } + ], + "getWorkResList": [ + { + "title": "포토샵", + "period": 13, + "startPrice": 25000, + "category": "SNS" + } + ], + "contactKakaoId": "jackcoke", + "contactEmail": "jackcoke@gmail.com" + }"""), schema = @Schema(implementation = SuccessResponse.class))) }) @GetMapping @@ -71,13 +96,35 @@ SuccessResponse createCreator( description = "크리에이터 등록 초기화면 불러오기 즉 크리에이터 등록을 클릭 시" +" 기존에 저장 되어 있던 크리에이터 정보 불러 온다.", content = @Content(mediaType = "application/json", - examples = @ExampleObject(value = "{\n" - + " \"timestamp\": \"2024-11-03T05:07:47.704694\",\n" - + " \"isSuccess\": true,\n" - + " \"code\": \"200\",\n" - + " \"message\": \"호출에 성공하였습니다.\",\n" - + " \"data\": \"null" - + "}"), + examples = @ExampleObject(value = """ + { + "nickname": "USER8543", + "profileImgUrl": "https~~", + "introductionTitle": "내가 최고라서", + "introductionContent": "저한테 맡겨만 주세요", + "getPortfolioResList": [ + { + "title": "제 첫번째 작품입니다.", + "thumbnailImgUrl": "https~", + "fileUrl": "https~" + }, + { + "title": "제 두번째 작품입니다.", + "thumbnailImgUrl": "https~", + "fileUrl": "https~" + } + ], + "getWorkResList": [ + { + "title": "포토샵", + "period": 13, + "startPrice": 25000, + "category": "SNS" + } + ], + "contactKakaoId": "jackcoke", + "contactEmail": "jackcoke@gmail.com" + }"""), schema = @Schema(implementation = SuccessResponse.class))) }) @GetMapping @@ -85,9 +132,11 @@ SuccessResponse createCreator( @Operation(summary = "크리에이터 찾기") @ApiResponses(value = { - @ApiResponse(responseCode = "200", + @ApiResponse( + responseCode = "200", description = "크리에이터 찾기에서 사용되는 API", - content = @Content(mediaType = "application/json", + content = @Content( + mediaType = "application/json", examples = @ExampleObject(value = """ { "timestamp": "2024-11-14T21:39:55.407616", @@ -134,9 +183,11 @@ SuccessResponse createCreator( ] } } - """ + """ ), - schema = @Schema(implementation = SuccessResponse.class))) + schema = @Schema(implementation = SuccessResponse.class) + ) + ) }) @GetMapping SuccessResponse> filteringCreator( diff --git a/src/main/java/org/example/gather_back_end/creator/dto/CreateCreatorReq.java b/src/main/java/org/example/gather_back_end/creator/dto/CreateCreatorReq.java index b841308..974aefc 100644 --- a/src/main/java/org/example/gather_back_end/creator/dto/CreateCreatorReq.java +++ b/src/main/java/org/example/gather_back_end/creator/dto/CreateCreatorReq.java @@ -1,5 +1,6 @@ package org.example.gather_back_end.creator.dto; +import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; import org.example.gather_back_end.domain.User; import org.example.gather_back_end.portfolio.dto.CreatePortfolioReq; @@ -10,12 +11,51 @@ @Builder public record CreateCreatorReq( + @Schema(description = "사용자가 입력한 크리에이터명", example = "Hong티쳐") String nickname, + + @Schema(description = "사용자가 입력한 소개글 제목", example = "전부 다 합니다.") String introductionTitle, + + @Schema(description = "사용자가 입력한 소개글", example = "이것저것 한지 오래 됐어요") String introductionContent, + + @Schema(description = "카카오톡 아이디", example = "Legend") String contactKaKaoId, + + @Schema(description = "사용자 이메일", example = "Hong@skuniv.ac.kr") String contactEmail, + + @Schema(description = "사용자 본인 포트폴리오", + example = """ + [ + { + "title": "이것도 합니다." + }, + { + "title": "저것도 합니다" + } + ]""") List createPortfolioReqList, + + @Schema(description = "사용자 작업 가능 항목", + example = """ + [ + { + "title": "다좋아", + "period": 13, + "startPrice": 25000, + "category": "PRINTS" + }, + { + "title": "그냥 좋아", + "period": 52, + "startPrice": 245000, + "category": "PRINTS" + } + ] + """ + ) List createWorkReqList ) { diff --git a/src/main/java/org/example/gather_back_end/openai/controller/OpenAiController.java b/src/main/java/org/example/gather_back_end/openai/controller/OpenAiController.java index a8b5680..508664d 100644 --- a/src/main/java/org/example/gather_back_end/openai/controller/OpenAiController.java +++ b/src/main/java/org/example/gather_back_end/openai/controller/OpenAiController.java @@ -32,13 +32,4 @@ public SuccessResponse requestToOpenAi( return SuccessResponse.of(response); } - @PostMapping("/test2") - public String test(Authentication authentication,@RequestBody String test) { - if (authentication == null) { - return "null입니다."; - } - else { - return test; - } - } } diff --git a/src/main/java/org/example/gather_back_end/test/controller/TestController.java b/src/main/java/org/example/gather_back_end/test/controller/TestController.java index 1aaf0f6..7e2878f 100644 --- a/src/main/java/org/example/gather_back_end/test/controller/TestController.java +++ b/src/main/java/org/example/gather_back_end/test/controller/TestController.java @@ -22,14 +22,4 @@ public SuccessResponse testException() { throw new TestNotFoundException(); } - @GetMapping("/jwt-test") - public SuccessResponse testJwt(Authentication authentication) { - if (authentication == null) { - return SuccessResponse.of("token is null"); - } - else { - CustomOAuth2User customOAuth2User = (CustomOAuth2User) authentication.getPrincipal(); - return SuccessResponse.of(customOAuth2User.getUsername()); - } - } } diff --git a/src/main/java/org/example/gather_back_end/user/controller/UserControllerApi.java b/src/main/java/org/example/gather_back_end/user/controller/UserControllerApi.java index 636e72d..4af41ef 100644 --- a/src/main/java/org/example/gather_back_end/user/controller/UserControllerApi.java +++ b/src/main/java/org/example/gather_back_end/user/controller/UserControllerApi.java @@ -32,4 +32,64 @@ public interface UserControllerApi { }) @GetMapping SuccessResponse getUser(Authentication authentication); + + @Operation(summary = "마이페이지 불러오기", + description = "마이페이지 불러오기, 토큰만 있으면 됩니다.") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "성공", + content = @Content(mediaType = "application/json", + examples = @ExampleObject(value = """ + { + "timestamp": "2024-11-16T00:51:05.668577", + "isSuccess": true, + "code": "200", + "message": "호출에 성공하였습니다.", + "data": { + "profileInfo": { + "profileImgUrl": null, + "role": "크리에이터", + "email": "kms2171344@hansung.ac.kr" + }, + "promotionInfo": [ + { + "createDay": "2024.11.12", + "title": "OOO 동아리 모집", + "period": 43, + "targetNumberOfPeople": 396, + "budget": 835000 + }, + { + "createDay": "2024.11.12", + "title": "OOO 동아리 모집", + "period": 43, + "targetNumberOfPeople": 396, + "budget": 835000 + }, + { + "createDay": "2024.11.13", + "title": "OOO 동아리 모집", + "period": 43, + "targetNumberOfPeople": 396, + "budget": 100000 + } + ], + "creatorInfo": [ + { + "nickname": "USER3322", + "availableWork": [ + "PRINTS", + "SNS_POST" + ], + "introductionTitle": "dkssudd", + "startPrice": "500", + "thumbnailImgUrl": "https~" + } + ] + } + } + """), + schema = @Schema(implementation = SuccessResponse.class))) + }) + @GetMapping + SuccessResponse getMyPage(Authentication authentication); }