diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/config/SwaggerConfig.java b/src/main/java/com/archisemtle/semtlewebserverspring/config/SwaggerConfig.java index 3d90f02..cc97f79 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/config/SwaggerConfig.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/config/SwaggerConfig.java @@ -40,8 +40,8 @@ public OpenAPI openAPI() { // API의 기본 정보 설정 private Info apiInfo() { return new Info() - .title("SemtleAPI") // API의 제목 - .description("셈틀API") // API에 대한 설명 + .title("SemtleServerAPI") // API의 제목 + .description("셈틀서버API") // API에 대한 설명 .version("1.0.0"); // API의 버전 } } \ No newline at end of file diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ApplyingController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ApplyingController.java index b264caf..0fcd3ff 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ApplyingController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ApplyingController.java @@ -5,6 +5,7 @@ import com.archisemtle.semtlewebserverspring.dto.ApplyProjectRequestDto; import com.archisemtle.semtlewebserverspring.dto.ApplyProjectResponseDto; import com.archisemtle.semtlewebserverspring.vo.ApplyProjectResponseVo; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.CrossOrigin; @@ -23,6 +24,7 @@ public class ApplyingController { private final ApplyProjectService applyProjectService; // 공고 신청 @PostMapping("/{post_id}/apply/{id}") + @Operation(summary = "공고 신청API", description = "공고에 사용자가 신성합니다.") public CommonResponse ApplyProject( @PathVariable("post_id") Integer boardId, @PathVariable("id") Integer applicantId, diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/AuthController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/AuthController.java index d4b1637..1700d5c 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/AuthController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/AuthController.java @@ -14,6 +14,7 @@ import com.archisemtle.semtlewebserverspring.infrastructure.MemberRepository; import com.archisemtle.semtlewebserverspring.vo.member.LoginResponseVo; import com.archisemtle.semtlewebserverspring.vo.member.MemberPasswordResetResponseVo; +import io.swagger.v3.oas.annotations.Operation; import java.util.UUID; import lombok.RequiredArgsConstructor; import org.springframework.security.core.Authentication; @@ -36,6 +37,7 @@ public class AuthController { // 로그인 @PostMapping("/signin") + @Operation(summary = "로그인API", description = "사용자가 로그인을 시도합니다.") public CommonResponse Login(@RequestBody LoginRequestDto loginRequestDto) { LoginResponseVo loginResponseVo = LoginResponseVo.dtoToVo( memberService.login(loginRequestDto)); @@ -43,6 +45,7 @@ public CommonResponse Login(@RequestBody LoginRequestDto loginR } @PostMapping("/password/reset/email") + @Operation(summary = "이메일을 통한 비밀번호 초기화API", description = "이메일을 통해서 비밀번호를 초기화하는 API입니다.") public CommonResponse requestPasswordReset( @RequestBody MemberPasswordResetEmailRequestDto memberPasswordResetEmailRequestDto ) { @@ -55,6 +58,7 @@ public CommonResponse requestPasswordReset( } @PostMapping("/password/reset") + @Operation(summary = "비밀번호 초기화API", description = "비밀번호를 초기화하는 API입니다.") public CommonResponse confirmPasswordReset( @RequestBody MemberPasswordResetRequestDto memberPasswordResetRequestDto ) { @@ -66,6 +70,7 @@ public CommonResponse confirmPasswordReset( } @PutMapping("/password/manager") + @Operation(summary = "관리자 2차 인증API", description = "관리자가 2차인증을 하는 API입니다.") public CommonResponse verifyAdmin( @RequestBody verifyAdminRequestDto verifyAdminRequestDto) { diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/BannerController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/BannerController.java index 10253b6..acad943 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/BannerController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/BannerController.java @@ -7,6 +7,7 @@ import com.archisemtle.semtlewebserverspring.dto.BannerResponseDto; import com.archisemtle.semtlewebserverspring.vo.BannerListResponseVo; import com.archisemtle.semtlewebserverspring.vo.BannerResponseVo; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.CrossOrigin; @@ -28,6 +29,7 @@ public class BannerController { // 배너 조회 @GetMapping("/banners") + @Operation(summary = "배너를 불러오는 API", description = "메인화면에 있는 배너를 불러오는 API입니다.") public CommonResponse getBanner() throws Exception{ BannerListResponseDto bannerListResponseDto = bannerService.getBannerList(); BannerListResponseVo bannerListResponseVo = BannerListResponseVo.dtoToVo(bannerListResponseDto.getBanners()); @@ -36,6 +38,7 @@ public CommonResponse getBanner() throws Exception{ // 배너 추가 @PostMapping("/banners") + @Operation(summary = "배너를 추가하는 API", description = "배너를 추가하는 API입니다.") public CommonResponse addBanner(@RequestBody BannerRequestDto bannerRequestDto) throws Exception { BannerResponseDto bannerResponseDto = bannerService.addBanner(bannerRequestDto); @@ -45,6 +48,7 @@ public CommonResponse addBanner(@RequestBody BannerRequestDto // 배너 삭제 @DeleteMapping("/banners/{banner_id}") + @Operation(summary = "배너를 삭제하는 API", description = "배너를 삭제하는 API입니다.") public CommonResponse deleteBanner(@PathVariable("banner_id") Integer bannerId) throws Exception { bannerService.deleteBanner(bannerId); return CommonResponse.success("배너 삭제 성공"); diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/MemberController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/MemberController.java index 0d508e6..89c97b3 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/MemberController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/MemberController.java @@ -25,6 +25,7 @@ import com.archisemtle.semtlewebserverspring.vo.member.MemberListResponseVo; import com.archisemtle.semtlewebserverspring.vo.member.MemberPasswordResetResponseVo; import com.archisemtle.semtlewebserverspring.vo.member.MemberReadResponseVo; +import io.swagger.v3.oas.annotations.Operation; import java.io.IOException; import java.time.ZonedDateTime; import java.util.List; @@ -48,6 +49,7 @@ public class MemberController { // 회원 입력 @PostMapping + @Operation(summary = "테스트 사용자를 추가하는 API", description = "테스트 사용자를 추가하는 API입니다.") public CommonResponse save( @RequestBody MemberRegistrationRequestDto memberRegistrationRequestDto) { memberService.save(memberRegistrationRequestDto); @@ -55,6 +57,7 @@ public CommonResponse save( } @PostMapping(value = "/signup", consumes = "multipart/form-data") + @Operation(summary = "사용자를 엑셀로 추가하는 API", description = "사용자를 엑셀로 추가하는 API입니다.") public CommonResponse excelAddMember( @RequestPart("file") @io.swagger.v3.oas.annotations.Parameter( @@ -82,6 +85,7 @@ public CommonResponse excelAddMember( // 입력 - uuid // 출력 - 이름, 생년월일, 전화번호, 학번, 프로필 사진 @GetMapping("/{uuid}") + @Operation(summary = "사용자 정보를 조회하는 API", description = "사용자 정보를 조회하는 API입니다.") public CommonResponse showMember(@PathVariable UUID uuid) { MemberReadResponseDto showMemberDto = memberService.show(uuid); MemberReadResponseVo responseVo = MemberReadResponseVo.dtoToVo(showMemberDto); @@ -91,6 +95,7 @@ public CommonResponse showMember(@PathVariable UUID uuid) // 개인 정보 수정 // uuid, 이름, 생년월일, 전화번호, 학번, 프로필 사진 @PatchMapping("/{uuid}") + @Operation(summary = "사용자를 정보를 수정하는 API", description = "사용자를 정보를 수정하는 API입니다.") public CommonResponse updateMember(@PathVariable UUID uuid, @RequestBody MemberUpdateRequestDto memberUpdateRequestDto) { memberService.update(uuid, memberUpdateRequestDto); @@ -99,6 +104,7 @@ public CommonResponse updateMember(@PathVariable UUID uuid, } @GetMapping + @Operation(summary = "사용자 리스트를 조회하는 API", description = "사용자 리스트를 조회하는 API입니다.") public CommonResponse getMemberList( @RequestParam(name = "page", defaultValue = "0") int page, @RequestParam(name = "size", defaultValue = "10") int size, @@ -130,6 +136,7 @@ public CommonResponse getMemberList( } @PatchMapping("/{uuid}/deactivate") + @Operation(summary = "사용자를 할동가능 여부를 수정하는 API", description = "사용자의 활동가능 여부를 수정하는 API입니다.") public CommonResponse deactivateMember( @PathVariable UUID uuid, @RequestBody MemberDeactiveRequestDto memberDeactiveRequestDto diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/OwnController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/OwnController.java index 81d414c..282b1d5 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/OwnController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/OwnController.java @@ -14,6 +14,7 @@ import com.archisemtle.semtlewebserverspring.infrastructure.ProjectBoardRepositoryImpl; import com.archisemtle.semtlewebserverspring.vo.ProjectBoardPageResponseVo; import com.archisemtle.semtlewebserverspring.vo.archive.ArchiveListResponseVo; +import io.swagger.v3.oas.annotations.Operation; import java.util.UUID; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Page; @@ -39,6 +40,7 @@ public class OwnController { private final ProjectBoardRepositoryImpl projectBoardRepository; @GetMapping("/archives") + @Operation(summary = "자신이 올린 족보목록을 조회하는 API", description = "자신이 올린 족보목록을 조회하는 API입니다.") public CommonResponse getOwnArchiveList( @RequestParam(name = "page", defaultValue = "1") int page, @RequestParam(name = "size", defaultValue = "10") int size, @@ -50,6 +52,7 @@ public CommonResponse getOwnArchiveList( } @GetMapping("/promotions") + @Operation(summary = "자신이 올린 프로젝트홍보목록을 조회하는 API", description = "자신이 올린 프로젝트홍보목록을 조회하는 API입니다.") public ResponseEntity> getPromotionsByOwnerId( @RequestParam(name = "page", defaultValue = "1", required = false) int page, @RequestParam(name = "size", defaultValue = "10", required = false) int size) { @@ -78,6 +81,7 @@ public ResponseEntity> getPromotionsByOwnerId( } @GetMapping("/mywritingprojectboard") + @Operation(summary = "자신이 올린 포르젝트 모집 목록을 조회하는 API", description = "자신이 올린 프로젝트 모집 목록을 조회하는 API입니다.") public CommonResponse> getMyWritingProjectBoard( @RequestParam(name = "page", defaultValue = "0") int page, @RequestParam(name = "size", defaultValue = "10") int size diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectApplicaionController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectApplicaionController.java index ca40e2c..e278611 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectApplicaionController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectApplicaionController.java @@ -11,6 +11,7 @@ import com.archisemtle.semtlewebserverspring.vo.ShowApplyingProjectListResponseVo; import com.archisemtle.semtlewebserverspring.vo.ShowProjectApplicantInfoResponseVo; import com.archisemtle.semtlewebserverspring.vo.ShowProjectApplicantsListResponseVo; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.CrossOrigin; @@ -32,52 +33,69 @@ public class ProjectApplicaionController { // 본인이 게시한 프로젝트(공고) 신청자 목록 조회 API @GetMapping("/{post_id}/applicants") + @Operation(summary = "자신이 신청한 프로젝트 목록을 조회하는 API", description = "자신이 신청한 프로젝트목록을 조회하는 API입니다.") public CommonResponse ShowProjectApplicantsList( @PathVariable("post_id") Integer postId, @RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int limit) throws Exception { - ProjectApplicantsResponseDto projectApplicantsResponseDto = projectApplicationService.getApplicants(postId, page, limit); - ShowProjectApplicantsListResponseVo showProjectApplicantsResponseVo = ShowProjectApplicantsListResponseVo.dtoToVo(projectApplicantsResponseDto); + ProjectApplicantsResponseDto projectApplicantsResponseDto = projectApplicationService.getApplicants( + postId, page, limit); + ShowProjectApplicantsListResponseVo showProjectApplicantsResponseVo = ShowProjectApplicantsListResponseVo.dtoToVo( + projectApplicantsResponseDto); - return CommonResponse.success("applicants Showed successfully", showProjectApplicantsResponseVo); + return CommonResponse.success("applicants Showed successfully", + showProjectApplicantsResponseVo); } // 본인이 게시한 프로젝트(공고) 신청자 정보(내용) 조회 API @GetMapping("/{post_id}/applicants/{id}") - public CommonResponse ShowProjectApplicantsInfo(@PathVariable("post_id") Integer boardId, @PathVariable("id") Integer applicantId) + @Operation(summary = "자신이 모집한 프로젝트에서 신청자 정보를 조회하는 API", description = "자신이 모집한 프로젝트에서 신청자 정보를 조회하는 API입니다.") + public CommonResponse ShowProjectApplicantsInfo( + @PathVariable("post_id") Integer boardId, @PathVariable("id") Integer applicantId) throws Exception { - ShowProjectApplicantInfoResponseDto showProjectApplicantInfoResponseDto = projectApplicationService.getApplicantInfo(boardId, applicantId); + ShowProjectApplicantInfoResponseDto showProjectApplicantInfoResponseDto = projectApplicationService.getApplicantInfo( + boardId, applicantId); - ShowProjectApplicantInfoResponseVo showProjectApplicantInfoResponseVo = ShowProjectApplicantInfoResponseVo.dtoToVo(showProjectApplicantInfoResponseDto); - return CommonResponse.success("applicants Info Showed successfully", showProjectApplicantInfoResponseVo); + ShowProjectApplicantInfoResponseVo showProjectApplicantInfoResponseVo = ShowProjectApplicantInfoResponseVo.dtoToVo( + showProjectApplicantInfoResponseDto); + return CommonResponse.success("applicants Info Showed successfully", + showProjectApplicantInfoResponseVo); } // 본인이 게시한 프로젝트(공고) 신청자 승인 상태 변경 API @PatchMapping("/{post_id}/applicants/{id}") + @Operation(summary = "자신이 모집한 프로젝트에서 신청자 승인 상태 변경하는 API", description = "자신이 모집한 프로젝트에서 신청자 승인 상태 변경하는 API입니다.") public CommonResponse ChangeApplyStatus( @PathVariable("post_id") Integer boardId, @PathVariable("id") Integer applicantId, @RequestBody ChangeApplyStatusRequestDto changeApplyStatusRequestDto - ) throws Exception { + ) throws Exception { - ChangeApplyStatusResponseDto changeApplyStatusResponseDto = projectApplicationService.changeApplyStatus(boardId,applicantId,changeApplyStatusRequestDto.getStatus()); + ChangeApplyStatusResponseDto changeApplyStatusResponseDto = projectApplicationService.changeApplyStatus( + boardId, applicantId, changeApplyStatusRequestDto.getStatus()); - ChangeApplyStatusResponseVo changeApplyStatusResponseVo = ChangeApplyStatusResponseVo.dtoToVo(changeApplyStatusResponseDto); - return CommonResponse.success("applicant Status changed successfully", changeApplyStatusResponseVo); + ChangeApplyStatusResponseVo changeApplyStatusResponseVo = ChangeApplyStatusResponseVo.dtoToVo( + changeApplyStatusResponseDto); + return CommonResponse.success("applicant Status changed successfully", + changeApplyStatusResponseVo); } // 본인이 신청한 프로젝트 목록 조회 (승인결과포함) API @GetMapping("/applications/{id}") + @Operation(summary = "자신이 신청한 프로젝트 목록 조회하는 API", description = "자신이 신청한 프로젝트 목록 조회하는 API입니다.") public CommonResponse ShowApplyingProjectList( @PathVariable("id") Integer applicantId, @RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int limit) throws Exception { - ShowApplyingProjectInfoResponseDto showApplyingProjectInfoResponseDto = projectApplicationService.getApplyingProjectInfo(applicantId, page, limit); + ShowApplyingProjectInfoResponseDto showApplyingProjectInfoResponseDto = projectApplicationService.getApplyingProjectInfo( + applicantId, page, limit); - ShowApplyingProjectListResponseVo showApplyingProjectListResponseVo = ShowApplyingProjectListResponseVo.dtoToVo(showApplyingProjectInfoResponseDto); - return CommonResponse.success("Applying applications Showed successfully", showApplyingProjectListResponseVo); + ShowApplyingProjectListResponseVo showApplyingProjectListResponseVo = ShowApplyingProjectListResponseVo.dtoToVo( + showApplyingProjectInfoResponseDto); + return CommonResponse.success("Applying applications Showed successfully", + showApplyingProjectListResponseVo); } } diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectBoardController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectBoardController.java index c20d4c4..aee65e8 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectBoardController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectBoardController.java @@ -14,6 +14,7 @@ import com.archisemtle.semtlewebserverspring.vo.ProjectBoardResponseVo; import com.archisemtle.semtlewebserverspring.vo.ProjectListRequestVo; import com.archisemtle.semtlewebserverspring.vo.UpdateProjectBoardRequestVo; +import io.swagger.v3.oas.annotations.Operation; import java.util.List; import java.util.UUID; import lombok.RequiredArgsConstructor; @@ -43,6 +44,7 @@ public class ProjectBoardController { private final ProjectBoardRepository projectBoardRepository; @PostMapping("/write") + @Operation(summary = "프로젝트 모집 게시물 작성 API", description = "프로젝트 모집 게시물 작성하는 API입니다.") public CommonResponse addProjectBoard( @RequestBody AddProjcetBoardRequestVo addProjcetBoardRequestVo) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); @@ -53,6 +55,7 @@ public CommonResponse addProjectBoard( } @GetMapping("/{projectBoardId}") + @Operation(summary = "프로젝트 모집 게시물 조회 API", description = "프로젝트 모집 게시물 조회하는 API입니다.") public CommonResponse getProjectBoardCommonResponse( @PathVariable("projectBoardId") Long id) { @@ -61,6 +64,7 @@ public CommonResponse getProjectBoardCommonResponse( } @DeleteMapping("/{projectBoardId}") + @Operation(summary = "프로젝트 모집 게시물 삭제 API", description = "프로젝트 모집 게시물 삭제하는 API입니다.") public CommonResponse deleteProjectBoard(@PathVariable("projectBoardId") Long id) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); UUID uuid = UUID.fromString(authentication.getName()); @@ -69,6 +73,7 @@ public CommonResponse deleteProjectBoard(@PathVariable("projectBoardId") } @PostMapping("/update/{projectBoardId}") + @Operation(summary = "프로젝트 모집 게시물 수정 API", description = "프로젝트 모집 게시물 수정하는 API입니다.") public CommonResponse updateProjectBoard(@PathVariable("projectBoardId") Long id, @RequestBody UpdateProjectBoardRequestVo updateProjectBoardRequestVo) { @@ -80,6 +85,7 @@ public CommonResponse updateProjectBoard(@PathVariable("projectBoardId") } @GetMapping("/projectboardlist") + @Operation(summary = "프로젝트 모집 게시물 리스트 조회 API(레거시)", description = "프로젝트 모집 게시물 리스트 조회하는 API입니다.") public CommonResponse> getProjectBoardList( @RequestParam(name = "page", defaultValue = "0") int page, @RequestParam(name = "size", defaultValue = "10") int size) { @@ -91,6 +97,7 @@ public CommonResponse> getProjectBoardList( } @GetMapping + @Operation(summary = "프로젝트 모집 게시물목록 (필터링) 조회 API", description = "프로젝트 모집 게시물목록 (필터링) 조회 API입니다.") public CommonResponse> getProjectBoardList2( @RequestParam(name = "page", defaultValue = "0") int page, @RequestParam(name = "size", defaultValue = "10") int size, @@ -107,6 +114,7 @@ public CommonResponse> getProjectBoardList2( } @GetMapping("/projectboardlist/{projectBoardId}") + @Operation(summary = "프로젝트 모집 게시물을 각각 조회 API(레거시)", description = "프로젝트 모집 게시물을 각각 조회하는 API입니다.") public CommonResponse getProjectBoardPageCommonResponse( @PathVariable("projectBoardId") Long id) { diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectTypeCategoryController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectTypeCategoryController.java index d84be10..7826382 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectTypeCategoryController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/ProjectTypeCategoryController.java @@ -3,6 +3,7 @@ import com.archisemtle.semtlewebserverspring.application.ProjectTypeCategoryService; import com.archisemtle.semtlewebserverspring.common.CommonResponse; import com.archisemtle.semtlewebserverspring.vo.ProjectTypeCategoryResponseVo; +import io.swagger.v3.oas.annotations.Operation; import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -20,6 +21,7 @@ public class ProjectTypeCategoryController { private final ProjectTypeCategoryService projectTypeCategoryService; @GetMapping("/categorylist") + @Operation(summary = "프로젝트 모집 카테고리 조회 API", description = "프로젝트 모집 카테고리 조회하는 API입니다.") public CommonResponse> ProjectTypeCategoryList() { return CommonResponse.success("", projectTypeCategoryService.getProjectTypeCategory().stream() diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/PromotionController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/PromotionController.java index 0a1b76b..9c0e419 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/PromotionController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/PromotionController.java @@ -6,6 +6,7 @@ import com.archisemtle.semtlewebserverspring.common.MessageConstants; import com.archisemtle.semtlewebserverspring.dto.*; import com.archisemtle.semtlewebserverspring.vo.*; +import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; @@ -25,154 +26,159 @@ public class PromotionController { private final PromotionService promotionService; @GetMapping + @Operation(summary = "프로젝트 홍보 게시물 목록 조회 API", description = "프로젝트 홍보 게시물 목록 조회하는 API입니다.") public ResponseEntity> getPromotions( - @RequestParam(name = "keyword", required = false) String keyword, - @RequestParam(name = "page", defaultValue = "1", required = false) int page, - @RequestParam(name = "size", defaultValue = "10", required = false) int size) { + @RequestParam(name = "keyword", required = false) String keyword, + @RequestParam(name = "page", defaultValue = "1", required = false) int page, + @RequestParam(name = "size", defaultValue = "10", required = false) int size) { if (page < 1) { return ResponseEntity - .status(HttpStatus.BAD_REQUEST) - .body(CommonResponse.fail(WRONG_PAGE_NUM_MIN)); + .status(HttpStatus.BAD_REQUEST) + .body(CommonResponse.fail(WRONG_PAGE_NUM_MIN)); } if (size < 1 || size > 100) { return ResponseEntity - .status(HttpStatus.BAD_REQUEST) - .body(CommonResponse.fail(WRONG_PAGE_NUM_MAX)); + .status(HttpStatus.BAD_REQUEST) + .body(CommonResponse.fail(WRONG_PAGE_NUM_MAX)); } - try{ + try { PromotionResponseDto responseDto = promotionService.getPromotions(keyword, page, size); //리턴문 Dto -> Vo 변경 0226 PromotionVo responseVo = PromotionVo.dtoToVo(responseDto); return ResponseEntity - .ok(CommonResponse.success(responseVo)); - }catch(Exception e){ + .ok(CommonResponse.success(responseVo)); + } catch (Exception e) { return ResponseEntity - .status(HttpStatus.INTERNAL_SERVER_ERROR) - .body(CommonResponse.fail(WRONG_SERVER)); + .status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(CommonResponse.fail(WRONG_SERVER)); } } @GetMapping("/{promotionId}") + @Operation(summary = "프로젝트 홍보 게시물 조회 API", description = "프로젝트 홍보 게시물 조회하는 API입니다.") public ResponseEntity> getPromotionsById( - @PathVariable("promotionId") Long id) { - if(id == null || id<0){ + @PathVariable("promotionId") Long id) { + if (id == null || id < 0) { return ResponseEntity - .status(HttpStatus.BAD_REQUEST) - .body(CommonResponse.fail(WRONG_PARAM)); + .status(HttpStatus.BAD_REQUEST) + .body(CommonResponse.fail(WRONG_PARAM)); } - try{ + try { ProjectPromotionResponseDto2 responseDto = promotionService.getPromotionsById(id); - if(responseDto == null){ + if (responseDto == null) { return ResponseEntity - .status(HttpStatus.BAD_REQUEST) - .body(CommonResponse.fail(NONE_DATA)); - }else{ + .status(HttpStatus.BAD_REQUEST) + .body(CommonResponse.fail(NONE_DATA)); + } else { return ResponseEntity - .ok(CommonResponse.success(responseDto)); + .ok(CommonResponse.success(responseDto)); } - }catch(Exception e){ + } catch (Exception e) { return ResponseEntity - .status(HttpStatus.INTERNAL_SERVER_ERROR) - .body(CommonResponse.fail(WRONG_SERVER)); + .status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(CommonResponse.fail(WRONG_SERVER)); } } @PostMapping + @Operation(summary = "프로젝트 홍보 게시물 작성 API", description = "프로젝트 홍보 게시물 작성하는 API입니다.") public ResponseEntity> createPromotion( - @Validated @RequestBody ProjectPromotionRequestDto reqDto, - BindingResult bindingResult) { + @Validated @RequestBody ProjectPromotionRequestDto reqDto, + BindingResult bindingResult) { if (bindingResult.hasErrors()) { String errorMessage = bindingResult.getFieldError().getDefaultMessage(); return ResponseEntity.status(HttpStatus.BAD_REQUEST) - .body(CommonResponse.fail(WRONG_PARAM,errorMessage)); + .body(CommonResponse.fail(WRONG_PARAM, errorMessage)); } - try{ + try { ProjectPromotionCUDResponseDto response = promotionService.mergePromotion(reqDto); PromotionCUDDtos.Create responseDto = new PromotionCUDDtos.Create( - "프로젝트 홍보 게시물이 성공적으로 등록되었습니다" - ,response.getBoardId() - ,response.getCreateDt()); + "프로젝트 홍보 게시물이 성공적으로 등록되었습니다" + , response.getBoardId() + , response.getCreateDt()); //리턴문 Dto -> Vo 변경 0226 PromotionCreateVo responseVo = PromotionCreateVo.dtoToVo(responseDto); return ResponseEntity - .ok(CommonResponse.success(MessageConstants.PROMOTION_CREATE_SUCCESS, responseVo)); - }catch(Exception e){ + .ok(CommonResponse.success(MessageConstants.PROMOTION_CREATE_SUCCESS, responseVo)); + } catch (Exception e) { return ResponseEntity - .status(HttpStatus.INTERNAL_SERVER_ERROR) - .body(CommonResponse.fail(WRONG_SERVER)); + .status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(CommonResponse.fail(WRONG_SERVER)); } } @PatchMapping("/{promotionId}") + @Operation(summary = "프로젝트 홍보 게시물 수정 API", description = "프로젝트 홍보 게시물 수정하는 API입니다.") public ResponseEntity> updatePromotion( - @RequestBody ProjectPromotionRequestDto reqDto, - @PathVariable("promotionId") Long id, - BindingResult bindingResult) { + @RequestBody ProjectPromotionRequestDto reqDto, + @PathVariable("promotionId") Long id, + BindingResult bindingResult) { if (bindingResult.hasErrors()) { String errorMessage = bindingResult.getFieldError().getDefaultMessage(); return ResponseEntity.status(HttpStatus.BAD_REQUEST) - .body(CommonResponse.fail(WRONG_PARAM,errorMessage)); + .body(CommonResponse.fail(WRONG_PARAM, errorMessage)); } - if(id == null || id<0){ + if (id == null || id < 0) { return ResponseEntity - .status(HttpStatus.NOT_FOUND) - .body(CommonResponse.fail(WRONG_PARAM)); + .status(HttpStatus.NOT_FOUND) + .body(CommonResponse.fail(WRONG_PARAM)); } - try{ + try { ProjectPromotionResponseDto2 checkPromotion = promotionService.getPromotionsById(id); - if(checkPromotion == null){ + if (checkPromotion == null) { return ResponseEntity - .status(HttpStatus.BAD_REQUEST) - .body(CommonResponse.fail(NOT_FOUND_DATA)); + .status(HttpStatus.BAD_REQUEST) + .body(CommonResponse.fail(NOT_FOUND_DATA)); } reqDto.setBoardId(id); ProjectPromotionCUDResponseDto response = promotionService.mergePromotion(reqDto); PromotionCUDDtos.Update responseDto = new PromotionCUDDtos.Update( - MessageConstants.PROMOTION_UPDATE_SUCCESS - ,response.getUpdateDt()); + MessageConstants.PROMOTION_UPDATE_SUCCESS + , response.getUpdateDt()); //리턴문 Dto -> Vo 변경 0226 PromotionUpdateVo responseVo = PromotionUpdateVo.dtoToVo(responseDto); return ResponseEntity - .ok(CommonResponse.success(MessageConstants.PROMOTION_UPDATE_SUCCESS, responseVo)); - }catch(Exception e){ + .ok(CommonResponse.success(MessageConstants.PROMOTION_UPDATE_SUCCESS, responseVo)); + } catch (Exception e) { return ResponseEntity - .status(HttpStatus.INTERNAL_SERVER_ERROR) - .body(CommonResponse.fail(WRONG_SERVER)); + .status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(CommonResponse.fail(WRONG_SERVER)); } } @DeleteMapping("/{promotionId}") + @Operation(summary = "프로젝트 홍보 게시물 삭제 API", description = "프로젝트 홍보 게시물 삭제하는 API입니다.") public ResponseEntity> deletePromotion( - @PathVariable("promotionId") Long id) { - if(id == null || id<0){ + @PathVariable("promotionId") Long id) { + if (id == null || id < 0) { return ResponseEntity - .status(HttpStatus.BAD_REQUEST) - .body(CommonResponse.fail(WRONG_PARAM)); + .status(HttpStatus.BAD_REQUEST) + .body(CommonResponse.fail(WRONG_PARAM)); } - try{ + try { ProjectPromotionResponseDto2 checkPromotion = promotionService.getPromotionsById(id); - if(checkPromotion == null){ + if (checkPromotion == null) { return ResponseEntity - .status(HttpStatus.BAD_REQUEST) - .body(CommonResponse.fail(NONE_DATA)); + .status(HttpStatus.BAD_REQUEST) + .body(CommonResponse.fail(NONE_DATA)); } ProjectPromotionCUDResponseDto response = promotionService.deletePromotion(id); PromotionCUDDtos.Update responseDto = new PromotionCUDDtos.Update( - MessageConstants.PROMOTION_DELETE_SUCCESS - ,response.getUpdateDt()); + MessageConstants.PROMOTION_DELETE_SUCCESS + , response.getUpdateDt()); //리턴문 Dto -> Vo 변경 0226 PromotionUpdateVo responseVo = PromotionUpdateVo.dtoToVo(responseDto); return ResponseEntity - .ok(CommonResponse.success(MessageConstants.PROMOTION_DELETE_SUCCESS, responseVo)); + .ok(CommonResponse.success(MessageConstants.PROMOTION_DELETE_SUCCESS, responseVo)); - }catch(Exception e){ + } catch (Exception e) { return ResponseEntity - .status(HttpStatus.INTERNAL_SERVER_ERROR) - .body(CommonResponse.fail(WRONG_SERVER)); + .status(HttpStatus.INTERNAL_SERVER_ERROR) + .body(CommonResponse.fail(WRONG_SERVER)); } } } diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/TestController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/TestController.java index 8b9914e..7d6af72 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/TestController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/TestController.java @@ -1,6 +1,7 @@ package com.archisemtle.semtlewebserverspring.presentation; import com.archisemtle.semtlewebserverspring.common.CommonResponse; +import io.swagger.v3.oas.annotations.Operation; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @@ -9,6 +10,7 @@ public class TestController { @GetMapping("/health") + @Operation(summary = "서버 테스트용 API", description = "서버 테스트용 API입니다.") public CommonResponse test() { return CommonResponse.success("api요청성공"); } diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/activity/ActivityController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/activity/ActivityController.java index d29c19a..b4119eb 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/activity/ActivityController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/activity/ActivityController.java @@ -13,6 +13,7 @@ import com.archisemtle.semtlewebserverspring.vo.activity.ActivityRequestVo; import com.archisemtle.semtlewebserverspring.vo.activity.ActivityResponseVo; import com.fasterxml.jackson.databind.ser.Serializers.Base; +import io.swagger.v3.oas.annotations.Operation; import jakarta.validation.Valid; import java.io.IOException; import java.util.ArrayList; @@ -48,6 +49,7 @@ public class ActivityController { //게시물 생성 @PostMapping + @Operation(summary = "활동 게시물 생성API", description = "활동 게시물을 생성합니다.") public CommonResponse createActivity(@RequestBody ActivityRequestVo requestVo) throws IOException { @@ -57,6 +59,7 @@ public CommonResponse createActivity(@RequestBody ActivityRequestVo requ //게시물 읽기 @GetMapping("/{id}") + @Operation(summary = "활동 게시물 읽기API", description = "활동 게시물을 읽어옵니다.") public CommonResponse getActivity(@PathVariable Long id){ ActivityResponseDto dto = activityService.readActivityBoard(id); return CommonResponse.success("게시물 읽기 성공", ActivityResponseDto.dtoToVo(dto)); @@ -64,6 +67,7 @@ public CommonResponse getActivity(@PathVariable Long id){ //게시물 수정 성공 @PutMapping("/{id}") + @Operation(summary = "활동 게시물 수정API", description = "활동 게시물을 수정합니다.") public CommonResponse updateActivity(@PathVariable Long id, @RequestBody ActivityRequestVo requestVo) throws IOException { @@ -73,12 +77,14 @@ public CommonResponse updateActivity(@PathVariable Long id, @RequestBody //게시물 삭제 성공 @DeleteMapping("/{id}") + @Operation(summary = "활동 게시물 삭제API", description = "활동 게시물을 삭제합니다.") public CommonResponse deleteActivity(@PathVariable Long id) { activityService.deleteActivityBoard(id); return CommonResponse.success("게시글 삭제 성공"); } @GetMapping + @Operation(summary = "활동 게시물 목록 읽기API", description = "활동 게시판 목록을 읽어옵니다.") public CommonResponse getActivityList( @RequestParam(name = "page", defaultValue = "1") int page, @RequestParam(name = "size", defaultValue = "15") int size, @@ -94,6 +100,7 @@ public CommonResponse getActivityList( } @GetMapping("/recent") + @Operation(summary = "최근 활동 게시물 목록읽기API", description = "최근 활동 게시물을 읽어옵니다.") public CommonResponse getCurActivityList( @RequestParam(name = "limit", defaultValue = "3") int limit){ diff --git a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/archive/ArchiveController.java b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/archive/ArchiveController.java index ce05073..228a21a 100644 --- a/src/main/java/com/archisemtle/semtlewebserverspring/presentation/archive/ArchiveController.java +++ b/src/main/java/com/archisemtle/semtlewebserverspring/presentation/archive/ArchiveController.java @@ -10,6 +10,7 @@ import com.archisemtle.semtlewebserverspring.vo.archive.ArchiveListResponseVo; import com.archisemtle.semtlewebserverspring.vo.archive.ArchiveRequestVo; import com.archisemtle.semtlewebserverspring.vo.archive.ArchiveResponseVo; +import io.swagger.v3.oas.annotations.Operation; import java.io.IOException; import lombok.RequiredArgsConstructor; import org.slf4j.Logger; @@ -36,6 +37,7 @@ public class ArchiveController { //게시물 생성 @PostMapping + @Operation(summary = "족보 게시물 생성API", description = "족보 게시물을 생성합니다.") public CommonResponse createArchive(@RequestBody ArchiveRequestVo requestVo) throws IOException{ archiveService.createArchiveBoard(ArchiveRequestVo.voToDto(requestVo)); return CommonResponse.success("Secret Note 게시물이 성공적으로 등록되었습니다."); @@ -43,6 +45,7 @@ public CommonResponse createArchive(@RequestBody ArchiveRequestVo reques //게시물 읽기 @GetMapping("/{id}") + @Operation(summary = "족보 게시물 읽기API", description = "족보 게시물을 읽어옵니다.") public CommonResponse readArchive(@PathVariable Long id){ ArchiveResponseDto responseDto = archiveService.readArchiveBoard(id); return CommonResponse.success("족보 게시판 흭득 성공", ArchiveResponseDto.dtoToVo(responseDto)); @@ -50,6 +53,7 @@ public CommonResponse readArchive(@PathVariable Long id){ //게시물 수정 @PutMapping("/{id}") + @Operation(summary = "족보 게시물 수정API", description = "족보 게시물을 수정합니다.") public CommonResponse updateArchive(@RequestBody ArchiveRequestVo requestVo, @PathVariable Long id) throws IOException { @@ -59,6 +63,7 @@ public CommonResponse updateArchive(@RequestBody ArchiveRequestVo reques //게시물 삭제 @DeleteMapping("/{id}") + @Operation(summary = "족보 게시물 삭제API", description = "족보 게시물을 삭제합니다.") public CommonResponse deleteArchive(@PathVariable Long id){ archiveService.deleteArchiveBoard(id); return CommonResponse.success("족보 게시판 삭제 성공"); @@ -66,6 +71,7 @@ public CommonResponse deleteArchive(@PathVariable Long id){ //게시물 목록 읽기 @GetMapping + @Operation(summary = "족보 게시물 목록 읽기API", description = "족보 게시물 목록 읽어옵니다.") public CommonResponse getArchiveList( @RequestParam(name = "page", defaultValue = "1") int page, @RequestParam(name = "size", defaultValue = "15") int size,