From ecf72dc0c589ffe91343ab0778641dfc1c667948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=98=88=EB=A6=BC?= <85860891+yerim216@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:35:48 +0900 Subject: [PATCH] Release Merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [SPR-192] refactor: 팔로우/팔로잉 조회 로직 수정, 팔로우/팔로잉 count 로직 수정 * [SPR-192] feat: 암장 이번주 팔로우 count 추가 코드 * [SPR-192] docs: 팔로우 조회 swagger 설명 추가 * [SPR-195] docs: 팔로우 조회 주석 삭제 * [SPR-192] docs: 팔로우 조회 swagger 주석 추가 * [SPR-195] feat: 공지사항 좋아요 관련 api 구현 * [SPR-195] docs: SwaggerError 추가 * [SPR-201] API담당자 추가 * [SPR-201] docs : API 담당자 지정 * [SPR-201] fix : 내가 작성한 숏츠 댓글 수정 - 응답에 shortsId 추가 * [SPR-201] fix : 태그에 번호 삭제 * [SPR-204] feat: 암장 관리자도 특정 암장 리뷰 조회 가능하도록 변경 (#161) * [SPR-202] feat: 관리자가 속한 암장의 id 값을 반환하는 API 구현 (#159) * [SPR-202] feat: 관리자가 속한 암장의 id 값을 반환하는 API 구현 * [SPR-202] feat: swagger api error 추가 * [SPR-202] fix: swagger api error 수정 * [SPR-203] feat: 암장 배경, 프로필 이미지를 Multipart에서 Url로 변경 (#160) * [SPR-205] feat: 유저 알림 허용 범위 조회 api 구현 --------- Co-authored-by: gourderased <117848386+gourderased@users.noreply.github.com> Co-authored-by: Ga Dong Sik <62535229+eple0329@users.noreply.github.com> --- .../domain/banner/BannerController.java | 5 +++ .../clear/BestClearClimberController.java | 2 ++ .../level/BestLevelClimberController.java | 2 ++ .../time/BestTimeClimberController.java | 2 ++ .../BestFollowGymController.java | 2 +- .../BestRecordGymController.java | 2 +- .../domain/bestroute/BestRouteController.java | 2 ++ .../domain/board/BoardController.java | 7 ++-- .../domain/boardlike/BoardLikeController.java | 7 ++-- .../domain/climber/ClimberController.java | 18 +++++----- .../climbinggym/ClimbingGymController.java | 34 +++++++++--------- .../climbinggym/ClimbingGymService.java | 14 +++----- .../ClimbingRecordController.java | 32 ++++++++--------- .../DifficultyMappingController.java | 6 ++-- .../evaluation/EvaluationController.java | 2 ++ .../FcmNotificationController.java | 6 ++-- .../FollowRelationshipController.java | 8 ++--- .../domain/manager/ManagerController.java | 17 ++++++--- .../domain/manager/ManagerService.java | 7 ++++ .../domain/review/ReviewController.java | 6 ++-- .../domain/review/ReviewRepository.java | 6 ++-- .../domain/review/ReviewService.java | 19 +++++----- .../domain/route/RouteController.java | 6 ++-- .../routerecord/RouteRecordController.java | 8 ++--- .../routeversion/RouteVersionController.java | 8 ++--- .../domain/sector/SectorController.java | 4 +-- .../domain/shorts/ShortsController.java | 24 ++++++------- .../ShortsBookmarkController.java | 11 +++--- .../ShortsCommentController.java | 10 +++--- .../shortscomment/ShortsCommentService.java | 1 + .../dto/ShortsCommentResponseDto.java | 4 ++- .../shortslike/ShortsLikeController.java | 4 ++- .../domain/user/UserController.java | 36 +++++++++++-------- .../domain/user/UserService.java | 6 ++++ .../domain/user/dto/UserResponseDto.java | 20 +++++++++++ .../global/s3/S3Controller.java | 14 +++++--- 36 files changed, 216 insertions(+), 146 deletions(-) diff --git a/src/main/java/com/climeet/climeet_backend/domain/banner/BannerController.java b/src/main/java/com/climeet/climeet_backend/domain/banner/BannerController.java index a4582dd7..1e1a2d19 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/banner/BannerController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/banner/BannerController.java @@ -4,6 +4,8 @@ import com.climeet.climeet_backend.domain.banner.dto.BannerResponseDto.BannerSimpleInfo; import com.climeet.climeet_backend.domain.user.User; import com.climeet.climeet_backend.global.security.CurrentUser; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; @@ -12,10 +14,13 @@ @RequiredArgsConstructor @RestController +@Tag(name = "Banner") + public class BannerController { private final BannerService bannerService; @GetMapping("api/banners") + @Operation(summary = "2701 [훈]") public ResponseEntity> getBannerListBetweenDates( @CurrentUser User user ){ diff --git a/src/main/java/com/climeet/climeet_backend/domain/bestclimber/clear/BestClearClimberController.java b/src/main/java/com/climeet/climeet_backend/domain/bestclimber/clear/BestClearClimberController.java index 58dd23a1..f4988c62 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/bestclimber/clear/BestClearClimberController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/bestclimber/clear/BestClearClimberController.java @@ -3,6 +3,7 @@ import com.climeet.climeet_backend.domain.bestclimber.clear.dto.BestClearClimberResponseDto.BestClearClimberDetailInfo; import com.climeet.climeet_backend.domain.user.User; import com.climeet.climeet_backend.global.security.CurrentUser; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import lombok.RequiredArgsConstructor; @@ -19,6 +20,7 @@ public class BestClearClimberController { private final BestClearClimberService bestClearClimberService; @GetMapping("/clear") + @Operation(summary = "701 - [훈]") public ResponseEntity> getClimberRankingListOrderClearCount( @CurrentUser User user ){ diff --git a/src/main/java/com/climeet/climeet_backend/domain/bestclimber/level/BestLevelClimberController.java b/src/main/java/com/climeet/climeet_backend/domain/bestclimber/level/BestLevelClimberController.java index 31de7fc8..2ca7487f 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/bestclimber/level/BestLevelClimberController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/bestclimber/level/BestLevelClimberController.java @@ -3,6 +3,7 @@ import com.climeet.climeet_backend.domain.bestclimber.level.dto.BestLevelClimberResponseDto.BestLevelClimberDetailInfo; import com.climeet.climeet_backend.domain.user.User; import com.climeet.climeet_backend.global.security.CurrentUser; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import lombok.RequiredArgsConstructor; @@ -19,6 +20,7 @@ public class BestLevelClimberController { private final BestLevelClimberService bestLevelClimberService; @GetMapping("/level") + @Operation(summary = "901 [훈]") public ResponseEntity> getClimberRankingListOrderLevel( @CurrentUser User user ){ diff --git a/src/main/java/com/climeet/climeet_backend/domain/bestclimber/time/BestTimeClimberController.java b/src/main/java/com/climeet/climeet_backend/domain/bestclimber/time/BestTimeClimberController.java index 0469715b..981336e3 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/bestclimber/time/BestTimeClimberController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/bestclimber/time/BestTimeClimberController.java @@ -3,6 +3,7 @@ import com.climeet.climeet_backend.domain.bestclimber.time.dto.BestTimeClimberResponseDto.BestTimeClimberDetailInfo; import com.climeet.climeet_backend.domain.user.User; import com.climeet.climeet_backend.global.security.CurrentUser; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import lombok.RequiredArgsConstructor; @@ -20,6 +21,7 @@ public class BestTimeClimberController { private final BestTimeClimberService bestTimeClimberService; @GetMapping("/time") + @Operation(summary = "401 [훈]") public ResponseEntity> getClimberRankingListOrderTime( @CurrentUser User user ){ diff --git a/src/main/java/com/climeet/climeet_backend/domain/bestfollowgym/BestFollowGymController.java b/src/main/java/com/climeet/climeet_backend/domain/bestfollowgym/BestFollowGymController.java index 53abfba0..2459d445 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/bestfollowgym/BestFollowGymController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/bestfollowgym/BestFollowGymController.java @@ -21,7 +21,7 @@ public class BestFollowGymController { /** * [GET] [팔로우 순] 이번주 짐 랭킹 조회 */ - @Operation(summary = "[팔로우 순] 이번주 짐 랭킹 조회") + @Operation(summary = "[팔로우 순] 이번주 짐 랭킹 조회 - 1801 [훈]") @GetMapping("/follow") public ResponseEntity> getGymRankingListOrderFollowCount() { return ResponseEntity.ok(bestFollowGymService.getGymRankingListOrderFollowCount()); diff --git a/src/main/java/com/climeet/climeet_backend/domain/bestrecordgym/BestRecordGymController.java b/src/main/java/com/climeet/climeet_backend/domain/bestrecordgym/BestRecordGymController.java index 004a39c9..9aafe676 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/bestrecordgym/BestRecordGymController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/bestrecordgym/BestRecordGymController.java @@ -19,7 +19,7 @@ public class BestRecordGymController { private final BestRecordGymService bestRecordGymService; - @Operation(summary = "[기록된 순(selected된 순)] 이번주 짐 랭킹 조회") + @Operation(summary = "[기록된 순(selected된 순)] 이번주 짐 랭킹 조회 - 601 [훈]") @GetMapping("/record") public ResponseEntity> getGymRankingListOrderSelectionCount( @CurrentUser User user diff --git a/src/main/java/com/climeet/climeet_backend/domain/bestroute/BestRouteController.java b/src/main/java/com/climeet/climeet_backend/domain/bestroute/BestRouteController.java index 6ec75b03..d1acf283 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/bestroute/BestRouteController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/bestroute/BestRouteController.java @@ -3,6 +3,7 @@ import com.climeet.climeet_backend.domain.bestroute.dto.BestRouteResponseDto.BestRouteDetailInfo; import com.climeet.climeet_backend.domain.user.User; import com.climeet.climeet_backend.global.security.CurrentUser; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import lombok.RequiredArgsConstructor; @@ -20,6 +21,7 @@ public class BestRouteController { private final BestRouteService bestRouteService; @GetMapping + @Operation(summary = "1901 [훈]") public ResponseEntity> getRouteRankingList( @CurrentUser User user ) { diff --git a/src/main/java/com/climeet/climeet_backend/domain/board/BoardController.java b/src/main/java/com/climeet/climeet_backend/domain/board/BoardController.java index 86ccb2ae..31dfd5ba 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/board/BoardController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/board/BoardController.java @@ -9,6 +9,7 @@ import com.climeet.climeet_backend.global.security.CurrentUser; import com.climeet.climeet_backend.global.utils.SwaggerApiError; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; @@ -21,6 +22,8 @@ @RestController @RequiredArgsConstructor +@Tag(name = "Board", description = "공지사항") + public class BoardController { private final BoardService boardService; @@ -38,14 +41,14 @@ public ResponseEntity> findBoards() { @GetMapping("/boards") @SwaggerApiError(ErrorStatus._EMPTY_USER) - @Operation(summary = "공지사항 전체 조회, 공지사항 글에 image없으면 null로 반환") + @Operation(summary = "공지사항 전체 조회, 공지사항 글에 image없으면 null로 반환 - 2001 [훈]") public ResponseEntity> findBoardList(){ return ResponseEntity.ok(boardService.findBoardList()); } @GetMapping("/boards/{boardId}") @SwaggerApiError({ErrorStatus._EMPTY_USER, ErrorStatus._BOARD_NOT_FOUND}) - @Operation(summary = "특정 공지사항 조회") + @Operation(summary = "특정 공지사항 조회 - 2002 [훈]") public ResponseEntity findBoardById(@CurrentUser User user, @PathVariable Long boardId){ return ResponseEntity.ok(boardService.findBoardById(boardId, user)); } diff --git a/src/main/java/com/climeet/climeet_backend/domain/boardlike/BoardLikeController.java b/src/main/java/com/climeet/climeet_backend/domain/boardlike/BoardLikeController.java index 3c7f6295..f313f77d 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/boardlike/BoardLikeController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/boardlike/BoardLikeController.java @@ -5,6 +5,7 @@ import com.climeet.climeet_backend.global.security.CurrentUser; import com.climeet.climeet_backend.global.utils.SwaggerApiError; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PatchMapping; @@ -13,10 +14,12 @@ @RestController @RequiredArgsConstructor +@Tag(name = "BoardLike", description = "[기록된 순(selected된 순)] 금주 베스트 루트 API") + public class BoardLikeController { private final BoardLikeService boardLikeService; - @PatchMapping("/boards/{boardId}/like") + @PatchMapping("/boards/{boardId}/like - 2801 [미리]") @SwaggerApiError({ErrorStatus._BOARD_NOT_FOUND, ErrorStatus._EXIST_BOARD_LIKE}) @Operation(summary = "특정 공지사항 좋아요") public ResponseEntity likeNotice(@CurrentUser User user, @PathVariable Long boardId){ @@ -24,7 +27,7 @@ public ResponseEntity likeNotice(@CurrentUser User user, @PathVariable L return ResponseEntity.ok("좋아요 완료"); } - @PatchMapping("/boards/{boardId}/unlike") + @PatchMapping("/boards/{boardId}/unlike - 2802 [미리]") @SwaggerApiError({ErrorStatus._BOARD_NOT_FOUND, ErrorStatus._UNEXIST_BOARD_LIKE}) @Operation(summary = "특정 공지사항 좋아요 취소") public ResponseEntity unLikeNotice(@CurrentUser User user, @PathVariable Long boardId){ diff --git a/src/main/java/com/climeet/climeet_backend/domain/climber/ClimberController.java b/src/main/java/com/climeet/climeet_backend/domain/climber/ClimberController.java index 9a399b2a..a54368b9 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/climber/ClimberController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/climber/ClimberController.java @@ -35,7 +35,7 @@ public class ClimberController { private final ClimberService climberService; @PostMapping("/login") - @Operation(summary = "OAuth 2.0 소셜 로그인", description = "**Enum 설명** : SocialType(provider에 입력)**: KAKAO, NAVER, APPLE \n\n responseType : SIGN_IN - 로그인 성공, SIGN_UP : 회원가입 필요, accessToken 필드의 토큰을 추가정보 입력 api에 넣어서 회원가입을 진행합니다.") + @Operation(summary = "OAuth 2.0 소셜 로그인 - 1301 [미리]", description = "**Enum 설명** : SocialType(provider에 입력)**: KAKAO, NAVER, APPLE \n\n responseType : SIGN_IN - 로그인 성공, SIGN_UP : 회원가입 필요, accessToken 필드의 토큰을 추가정보 입력 api에 넣어서 회원가입을 진행합니다.") @SwaggerApiError({ErrorStatus._BAD_REQUEST, ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_MANAGER_GYM, ErrorStatus._INVALID_JWT, ErrorStatus._EXPIRED_JWT}) public ResponseEntity login(@RequestParam String provider, @RequestBody ClimberTokenRequest climberTokenRequest) { @@ -46,13 +46,13 @@ public ResponseEntity login(@RequestParam String provider, @Req } @PostMapping("/signup/extra") - @Operation(summary = "회원가입 추가 정보 입력 api", description = "\n\n**ClimbingLevel** : BEGINNER, NOVICE, INTERMEDIATE, ADVANCED, EXPERT\n\n**DiscoveryChannel** : INSTAGRAM_FACEBOOK, YOUTUBE, FRIEND_RECOMMENDATION, BLOG_CAFE_COMMUNITY, OTHER**") + @Operation(summary = "회원가입 추가 정보 입력 api - 1302 [미리]", description = "\n\n**ClimbingLevel** : BEGINNER, NOVICE, INTERMEDIATE, ADVANCED, EXPERT\n\n**DiscoveryChannel** : INSTAGRAM_FACEBOOK, YOUTUBE, FRIEND_RECOMMENDATION, BLOG_CAFE_COMMUNITY, OTHER**") public ResponseEntity signUp(@RequestBody CreateClimberRequest createClimberRequest) { return ResponseEntity.ok(climberService.signUp(createClimberRequest)); } @GetMapping("/check-nickname/{nickName}") - @Operation(summary = "클라이머 닉네임 중복 확인", description = "**이미 존재하는 닉네임** : false \n\n **사용 가능한 닉네임** : true") + @Operation(summary = "클라이머 닉네임 중복 확인 - 1303 [미리]", description = "**이미 존재하는 닉네임** : false \n\n **사용 가능한 닉네임** : true") public ResponseEntity checkNickName(@PathVariable String nickName){ boolean isDuplicated = !climberService.checkNicknameDuplication(nickName); return ResponseEntity.ok(isDuplicated); @@ -60,41 +60,41 @@ public ResponseEntity checkNickName(@PathVariable String nickName){ } @GetMapping("/search") - @Operation(summary = "클라이머 검색 기능") + @Operation(summary = "클라이머 검색 기능 - 1304 [미리]") public ResponseEntity>> getClimberSearchingList(@CurrentUser User currentUser, @RequestParam int page, @RequestParam int size, @RequestParam String climberName){ return ResponseEntity.ok(climberService.searchClimber(currentUser, climberName, page, size)); } @GetMapping("/privacy-setting") - @Operation(summary = "클라이머 정보 공개 여부 조회(쇼츠, 홈짐, 평균완등률, 평균레벨)") + @Operation(summary = "클라이머 정보 공개 여부 조회(쇼츠, 홈짐, 평균완등률, 평균레벨) - 1305 [미리]") public ResponseEntity getClimberPrivacyStatus(@CurrentUser User currentUser, @RequestParam long climberId){ return ResponseEntity.ok(climberService.getClimberPrivacySetting(climberId)); } @PatchMapping("/shorts-privacy-setting") - @Operation(summary = "클라이머 쇼츠 공개 여부 변경") + @Operation(summary = "클라이머 쇼츠 공개 여부 변경 - 1306 [미리]") public ResponseEntity updateShortsPrivacyStatus(@CurrentUser User user){ climberService.updateShortsPrivacySetting(user); return ResponseEntity.ok("공개 여부 변경 완료"); } @PatchMapping("/homegym-privacy-setting") - @Operation(summary = "클라이머 홈짐 공개 여부 변경") + @Operation(summary = "클라이머 홈짐 공개 여부 변경 - 1307 [미리]") public ResponseEntity updateHomeGymPrivacyStatus(@CurrentUser User user){ climberService.updateHomeGymPrivacySetting(user); return ResponseEntity.ok("공개 여부 변경 완료"); } @PatchMapping("/averageCompletionRate-privacy-setting") - @Operation(summary = "클라이머 평균완등률 공개 여부 변경") + @Operation(summary = "클라이머 평균완등률 공개 여부 변경 - 1308 [미리]") public ResponseEntity updateAverageCompletionRatePrivacyStatus(@CurrentUser User user){ climberService.updateAverageCompletionRatePrivacySetting(user); return ResponseEntity.ok("공개 여부 변경 완료"); } @PatchMapping("/averageCompletionLevel-privacy-setting") - @Operation(summary = "클라이머 평균완등레벨 공개 여부 변경") + @Operation(summary = "클라이머 평균완등레벨 공개 여부 변경 - 1309 [미리]") public ResponseEntity updateAverageCompletionLevelPrivacyStatus(@CurrentUser User user){ climberService.updateAverageCompletionLevelPrivacySetting(user); return ResponseEntity.ok("공개 여부 변경 완료"); diff --git a/src/main/java/com/climeet/climeet_backend/domain/climbinggym/ClimbingGymController.java b/src/main/java/com/climeet/climeet_backend/domain/climbinggym/ClimbingGymController.java index d73229f9..fb284610 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/climbinggym/ClimbingGymController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/climbinggym/ClimbingGymController.java @@ -26,9 +26,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; @Tag(name = "ClimbingGym", description = "암장 관련 API") @RestController @@ -38,7 +36,7 @@ public class ClimbingGymController { private final ClimbingGymService climbingGymService; - @Operation(summary = "전국 암장 검색 기능(자체 목록화)") + @Operation(summary = "전국 암장 검색 기능(자체 목록화) - 1010 [무빗]") @GetMapping("/search/all") public ResponseEntity>> getClimbingGymSearchingList( @RequestParam("gymname") String gymName, @RequestParam int page, @RequestParam int size @@ -46,7 +44,7 @@ public ResponseEntity>> getClimb return ResponseEntity.ok(climbingGymService.searchClimbingGym(gymName, page, size)); } - @Operation(summary = "Manager가 등록된 암장 검색 기능") + @Operation(summary = "Manager가 등록된 암장 검색 기능 - 1009 [무빗]") @GetMapping("/search") public ResponseEntity>> getAcceptedClimbingGymSearchingList( @RequestParam("gymname") String gymName, @RequestParam int page, @RequestParam int size @@ -54,7 +52,7 @@ public ResponseEntity>> return ResponseEntity.ok(climbingGymService.searchAcceptedClimbingGym(gymName, page, size)); } - @Operation(summary = "암장 프로필 정보 (상단) 불러오기") + @Operation(summary = "암장 프로필 정보 (상단) 불러오기 - 1001 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_MANAGER, ErrorStatus._EMPTY_BACKGROUND_IMAGE}) @GetMapping("/{gymId}") @@ -64,7 +62,7 @@ public ResponseEntity getClimbingGymInfo( } - @Operation(summary = "암장 프로필 정보 (탭) 불러오기", description = "탭에 들어가는 데이터는 null이 존재할 가능성이 상당히 높습니다.\n 또한 영업시간에서 특정 요일만 값이 없다면 정기휴일입니다.") + @Operation(summary = "암장 프로필 정보 (탭) 불러오기 - 1005 [무빗]", description = "탭에 들어가는 데이터는 null이 존재할 가능성이 상당히 높습니다.\n 또한 영업시간에서 특정 요일만 값이 없다면 정기휴일입니다.") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._ERROR_JSON_PARSE}) @GetMapping("/{gymId}/tab") public ResponseEntity getClimbingGymTabInfo( @@ -72,7 +70,7 @@ public ResponseEntity getClimbingGymTabInfo( return ResponseEntity.ok(climbingGymService.getClimbingGymTabInfo(gymId)); } - @Operation(summary = "암장 크롤링 정보 입력") + @Operation(summary = "암장 크롤링 정보 입력 - 1002 [무빗]") @PostMapping("/{gymId}/info") public ResponseEntity updateClimbingGymInfo( @PathVariable Long gymId) { @@ -89,23 +87,25 @@ public ResponseEntity> getFollowingU climbingGymService.getFollowingUserAverageLevelInClimbingGym(gymId, user)); } - @Operation(summary = "암장 배경사진 변경 (1개만 등록 가능)") + @Operation(summary = "암장 배경사진 변경 (1개만 등록 가능) - 1006 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_MANAGER, ErrorStatus._EMPTY_BACKGROUND_IMAGE}) @PatchMapping("/background-image") public ResponseEntity changeClimbingGymBackgroundImage(@CurrentUser User user, - @RequestPart MultipartFile image) { - return ResponseEntity.ok(climbingGymService.changeClimbingGymBackgroundImage(user, image)); + @RequestBody String imageUrl) { + climbingGymService.changeClimbingGymBackgroundImage(user, imageUrl); + return ResponseEntity.ok("암장 배경사진 변경을 완료했습니다."); } - @Operation(summary = "암장 프로필 이미지 변경 (1개만 등록 가능)") + @Operation(summary = "암장 프로필 이미지 변경 (1개만 등록 가능) - 1008 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_MANAGER}) @PatchMapping("/profile-image") public ResponseEntity changeClimbingGymProfileImage(@CurrentUser User user, - @RequestPart MultipartFile image) { - return ResponseEntity.ok(climbingGymService.changeClimbingGymProfileImage(user, image)); + @RequestBody String imageUrl) { + climbingGymService.changeClimbingGymProfileImage(user, imageUrl); + return ResponseEntity.ok("관리자 프로필 이미지 변경을 완료했습니다."); } - @Operation(summary = "암장 제공 서비스 수정", description = "**Enum 설명**\n\n**ServiceBitmask** : 샤워\\_시설, 샤워\\_용품, 수건\\_제공, 간이\\_세면대, 초크\\_대여, 암벽화\\_대여, 삼각대\\_대여, 운동복\\_대여") + @Operation(summary = "암장 제공 서비스 수정 - 1012 [무빗]", description = "**Enum 설명**\n\n**ServiceBitmask** : 샤워\\_시설, 샤워\\_용품, 수건\\_제공, 간이\\_세면대, 초크\\_대여, 암벽화\\_대여, 삼각대\\_대여, 운동복\\_대여") @SwaggerApiError({ErrorStatus._EMPTY_MANAGER}) @PatchMapping("/service") public ResponseEntity updateClimbingGymService(@CurrentUser User user, @@ -114,7 +114,7 @@ public ResponseEntity updateClimbingGymService(@CurrentUser User user, return ResponseEntity.ok("암장 제공 서비스를 정상적으로 변경했습니다."); } - @Operation(summary = "기본 가격(제공) 추가 & 수정") + @Operation(summary = "기본 가격(제공) 추가 & 수정 - 1007 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_MANAGER, ErrorStatus._ERROR_JSON_PARSE}) @PostMapping("/price") public ResponseEntity updateClimbingGymPrice(@CurrentUser User user, @@ -123,7 +123,7 @@ public ResponseEntity updateClimbingGymPrice(@CurrentUser User user, return ResponseEntity.ok("암장 기본 제공을 정상적으로 변경했습니다."); } - @Operation(summary = "Manager가 등록된 암장 검색 기능 + 팔로잉 여부") + @Operation(summary = "Manager가 등록된 암장 검색 기능 + 팔로잉 여부 - 1011 [무빗]") @SwaggerApiError({}) @GetMapping("/search/follow") public ResponseEntity>> getAcceptedClimbingGymSearchingListWithFollow( @@ -134,7 +134,7 @@ public ResponseEntity getFollowingUserAverageLevelInClimbingGym( diff --git a/src/main/java/com/climeet/climeet_backend/domain/climbinggym/ClimbingGymService.java b/src/main/java/com/climeet/climeet_backend/domain/climbinggym/ClimbingGymService.java index 552c8446..5e1e179a 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/climbinggym/ClimbingGymService.java +++ b/src/main/java/com/climeet/climeet_backend/domain/climbinggym/ClimbingGymService.java @@ -42,7 +42,6 @@ import org.springframework.data.domain.Slice; import org.springframework.stereotype.Service; import org.springframework.web.client.RestClient; -import org.springframework.web.multipart.MultipartFile; @RequiredArgsConstructor @Service @@ -228,7 +227,7 @@ public List getFollowingUserAverageLevelI .toList(); } - public String changeClimbingGymBackgroundImage(User user, MultipartFile image) { + public void changeClimbingGymBackgroundImage(User user, String imageUrl) { Manager manager = managerRepository.findById(user.getId()) .orElseThrow(() -> new GeneralException(ErrorStatus._EMPTY_MANAGER)); @@ -236,21 +235,16 @@ public String changeClimbingGymBackgroundImage(User user, MultipartFile image) { manager.getClimbingGym()) .orElseThrow(() -> new GeneralException(ErrorStatus._EMPTY_BACKGROUND_IMAGE)); - String backgroundImageUrl = s3Service.uploadFile(image).getImgUrl(); - climbingGymBackgroundImage.changeImgUrl(backgroundImageUrl); + climbingGymBackgroundImage.changeImgUrl(imageUrl); climbingGymBackgroundImageRepository.save(climbingGymBackgroundImage); - - return backgroundImageUrl; } - public String changeClimbingGymProfileImage(User user, MultipartFile image) { + public void changeClimbingGymProfileImage(User user, String imageUrl) { Manager manager = managerRepository.findById(user.getId()) .orElseThrow(() -> new GeneralException(ErrorStatus._EMPTY_MANAGER)); ClimbingGym climbingGym = manager.getClimbingGym(); - String profileImageUrl = s3Service.uploadFile(image).getImgUrl(); - climbingGym.updateProfileImageUrl(profileImageUrl); + climbingGym.updateProfileImageUrl(imageUrl); climbingGymRepository.save(climbingGym); - return profileImageUrl; } public void updateClimbingGymService(User user, diff --git a/src/main/java/com/climeet/climeet_backend/domain/climbingrecord/ClimbingRecordController.java b/src/main/java/com/climeet/climeet_backend/domain/climbingrecord/ClimbingRecordController.java index 383322eb..1028ba7d 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/climbingrecord/ClimbingRecordController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/climbingrecord/ClimbingRecordController.java @@ -43,7 +43,7 @@ public class ClimbingRecordController { private final ClimbingRecordService climbingRecordService; - @Operation(summary = "클라이밍 기록 생성") + @Operation(summary = "클라이밍 기록 생성 - 1201 [훈]") @PostMapping @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_ROUTE}) public ResponseEntity createClimbingRecord( @@ -53,7 +53,7 @@ public ResponseEntity createClimbingRecord( return ResponseEntity.ok("클라이밍 기록을 생성하였습니다."); } - @Operation(summary = "클라이밍 간편 기록 전체 조회") + @Operation(summary = "클라이밍 간편 기록 전체 조회 - 1202 [훈]") @GetMapping @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_RECORD}) public ResponseEntity> getClimbingRecordList( @@ -62,7 +62,7 @@ public ResponseEntity> getClimbingRecordList( return ResponseEntity.ok(climbingRecordService.getClimbingRecordList()); } - @Operation(summary = "클라이밍 기록 id 조회 (루트기록들 포함. 단, 루트 기록은 없어도 예외처리하지 않음.)") + @Operation(summary = "클라이밍 기록 id 조회 (루트기록들 포함. 단, 루트 기록은 없어도 예외처리하지 않음.) - 1203 [훈]") @GetMapping("/{id}") @SwaggerApiError({ErrorStatus._CLIMBING_RECORD_NOT_FOUND}) public ResponseEntity getClimbingRecordById( @@ -72,7 +72,7 @@ public ResponseEntity getClimbingRecordById( } - @Operation(summary = "나의 클라이밍 기록 날짜 조회") + @Operation(summary = "나의 클라이밍 기록 날짜 조회 - 1204 [훈]") @GetMapping("/between-dates") @SwaggerApiError({ErrorStatus._INVALID_DATE_RANGE, ErrorStatus._INVALID_MEMBER}) @@ -86,7 +86,7 @@ public ResponseEntity> getClimbingRecordListBetwe } - @Operation(summary = "ClimbingRecord 수정") + @Operation(summary = "ClimbingRecord 수정 - 1205 [훈]") @PatchMapping("/{id}") @SwaggerApiError({ErrorStatus._CLIMBING_RECORD_NOT_FOUND, ErrorStatus._INVALID_MEMBER}) public ResponseEntity updateClimbingRecord( @@ -97,7 +97,7 @@ public ResponseEntity updateClimbingRecord( climbingRecordService.updateClimbingRecord(user, id, updateClimbingRecord)); } - @Operation(summary = "ClimbingRecord 삭제") + @Operation(summary = "ClimbingRecord 삭제 - 1206 [훈]") @DeleteMapping("/{id}") @SwaggerApiError({ErrorStatus._CLIMBING_RECORD_NOT_FOUND, ErrorStatus._INVALID_MEMBER}) public ResponseEntity deleteClimbingRecord( @@ -107,7 +107,7 @@ public ResponseEntity deleteClimbingRecord( return ResponseEntity.ok("클라이밍 기록을 삭제하였습니다."); } - @Operation(summary = "나의 월별 운동기록 통계") + @Operation(summary = "나의 월별 운동기록 통계 - 1207 [훈]") @GetMapping("/users/statistics/months") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_RECORD, ErrorStatus._INVALID_MEMBER}) public ResponseEntity getClimbingStatisticsMonthly( @@ -118,7 +118,7 @@ public ResponseEntity getClimbingStatisticsMonthly climbingRecordService.getClimbingRecordStatistics(user, year, month)); } - @Operation(summary = "특정 암장에 대한 나의 월 통계") + @Operation(summary = "특정 암장에 대한 나의 월 통계 - 1208 [훈]") @GetMapping("/users/gyms/{gymId}/statistics/months") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_RECORD, ErrorStatus._INVALID_MEMBER}) public ResponseEntity getClimbingStatisticsByGymMonthly( @@ -130,7 +130,7 @@ public ResponseEntity getClimbingStatisticsBy climbingRecordService.getClimbingRecordStatisticsByGymId(user, gymId, year, month)); } - @Operation(summary = "암장별 주간 평균 완등률 통계 ") + @Operation(summary = "암장별 주간 평균 완등률 통계 - 1209 [훈]") @GetMapping("/gyms/{gymId}/statistics/weeks") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM}) public ResponseEntity getGymStatisticsWeekly( @@ -141,7 +141,7 @@ public ResponseEntity getGymStatisticsWeekly climbingRecordService.getGymStatisticsWeekly(gymId)); } - @Operation(summary = "[완등순] 암장별 클라이머 랭킹") + @Operation(summary = "[완등순] 암장별 클라이머 랭킹 - 1210 [훈]") @GetMapping("/gyms/{gymId}/rank/weeks/climbers/clear") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM}) public ResponseEntity> getClimberRankingListOrderClearCountByGym( @@ -150,7 +150,7 @@ public ResponseEntity> getClimberRankingListOrderC return ResponseEntity.ok(climbingRecordService.getClimberRankingListOrderClearCountByGym(gymId)); } - @Operation(summary = "[시간순] 암장별 클라이머 랭킹") + @Operation(summary = "[시간순] 암장별 클라이머 랭킹 - 1211 [훈]") @GetMapping("/gyms/{gymId}/rank/weeks/climbers/time") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM}) public ResponseEntity> getClimberRankingListOrderTimeByGym( @@ -159,7 +159,7 @@ public ResponseEntity> getClimberRankingListOrderTi return ResponseEntity.ok(climbingRecordService.getClimberRankingListOrderTimeByGym(gymId)); } - @Operation(summary = "[높은 레벨순] 암장별 클라이머 랭킹") + @Operation(summary = "[높은 레벨순] 암장별 클라이머 랭킹 - 1212 [훈]") @GetMapping("/gyms/{gymId}/rank/weeks/climbers/level") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM}) public ResponseEntity> getClimberRankingListOrderLevelByGym( @@ -168,7 +168,7 @@ public ResponseEntity> getClimberRankingListOrderL return ResponseEntity.ok(climbingRecordService.getClimberRankingListOrderLevelByGym(gymId)); } - @Operation(summary = "[유저프로필] 유저별 전체 암장에 대한 누적 통계") + @Operation(summary = "[유저프로필] 유저별 전체 암장에 대한 누적 통계 - 1213 [훈]") @GetMapping("/users/{userId}/statistics") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM}) public ResponseEntity getUserStatistics( @@ -177,7 +177,7 @@ public ResponseEntity getUserStatistics( return ResponseEntity.ok(climbingRecordService.getUserStatistics(userId)); } - @Operation(summary = "유저별 특정 암장에 대한 누적 통계") + @Operation(summary = "유저별 특정 암장에 대한 누적 통계 - 1214 [훈]") @GetMapping("/users/{userId}/gyms/{gymId}/statistics") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM}) public ResponseEntity getUserStatistics( @@ -188,7 +188,7 @@ public ResponseEntity getUserStati return ResponseEntity.ok(climbingRecordService.getUserStatisticsByGym(userId, gymId)); } - @Operation(summary = "유저별 운동한 암장 리스트 조회") + @Operation(summary = "유저별 운동한 암장 리스트 조회 - 1215 [훈]") @GetMapping("/users/{userId}/list") public ResponseEntity> getVisitedGymList( @CurrentUser User user, @@ -196,7 +196,7 @@ public ResponseEntity> getVisitedGymList( return ResponseEntity.ok(climbingRecordService.getVisitedGymList(userId)); } - @Operation(summary = "나의 운동한 암장 리스트 조회") + @Operation(summary = "나의 운동한 암장 리스트 조회 - 1216 [훈]") @GetMapping("/users/months/list") public ResponseEntity> getVisitedGymList( @CurrentUser User user, diff --git a/src/main/java/com/climeet/climeet_backend/domain/difficultymapping/DifficultyMappingController.java b/src/main/java/com/climeet/climeet_backend/domain/difficultymapping/DifficultyMappingController.java index 0616cd02..c08b637f 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/difficultymapping/DifficultyMappingController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/difficultymapping/DifficultyMappingController.java @@ -28,7 +28,7 @@ public class DifficultyMappingController { private final DifficultyMappingService difficultyMappingService; - @Operation(summary = "클밋, 암장 난이도 매핑 생성") + @Operation(summary = "클밋, 암장 난이도 매핑 생성 - 1501 [무빗]") @SwaggerApiError({ErrorStatus._INVALID_DIFFICULTY, ErrorStatus._EMPTY_MANAGER}) @PostMapping("/difficulty") public ResponseEntity> createDifficultyMapping(@CurrentUser User user, @@ -38,7 +38,7 @@ public ResponseEntity> createDifficultyMapping(@CurrentUser User user difficultyMappingService.createDifficultyMapping(user, createDifficultyMappingRequest)); } - @Operation(summary = "클밋, 암장 난이도 매핑 조회") + @Operation(summary = "클밋, 암장 난이도 매핑 조회 - 1502 [무빗]") @SwaggerApiError({ErrorStatus._INVALID_DIFFICULTY, ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_DIFFICULTY_LIST}) @GetMapping("/{gymId}/difficulty") @@ -48,7 +48,7 @@ public ResponseEntity> getDifficultyMappin return ResponseEntity.ok(difficultyMappingService.getDifficultyMapping(gymId)); } - @Operation(summary = "암장 색 코드 목록 조회") + @Operation(summary = "암장 색 코드 목록 조회 - 1503 [무빗]") @SwaggerApiError({}) @GetMapping("/difficulty/color") public ResponseEntity> getGymDifficultyColorList( diff --git a/src/main/java/com/climeet/climeet_backend/domain/evaluation/EvaluationController.java b/src/main/java/com/climeet/climeet_backend/domain/evaluation/EvaluationController.java index c8227f40..8a0ff96a 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/evaluation/EvaluationController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/evaluation/EvaluationController.java @@ -3,6 +3,7 @@ import com.climeet.climeet_backend.domain.evaluation.dto.EvaluationRequestDto.CreateEvaluation; import com.climeet.climeet_backend.domain.user.User; import com.climeet.climeet_backend.global.security.CurrentUser; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; @@ -20,6 +21,7 @@ public class EvaluationController { private final EvaluationService evaluationService; @PostMapping + @Operation(summary = "801 [훈]") public ResponseEntity createEvaluation(@CurrentUser User user, @RequestBody CreateEvaluation requestDto) { return evaluationService.createEvaluation(user, requestDto); diff --git a/src/main/java/com/climeet/climeet_backend/domain/fcmNotification/FcmNotificationController.java b/src/main/java/com/climeet/climeet_backend/domain/fcmNotification/FcmNotificationController.java index 332beaf9..4674aa50 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/fcmNotification/FcmNotificationController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/fcmNotification/FcmNotificationController.java @@ -4,6 +4,7 @@ import com.climeet.climeet_backend.domain.fcmNotification.dto.FcmNotificationRequestDto.CreatePushNotificationRequest; import com.google.firebase.messaging.FirebaseMessagingException; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; @@ -16,11 +17,12 @@ @RestController @RequiredArgsConstructor @RequestMapping("/api/messaging") +@Tag(name = "Push-Notification", description = "[기록된 순(selected된 순)] 금주 베스트 루트 API") public class FcmNotificationController { private final FcmNotificationService fcmNotificationService; @PostMapping("/push-notification-singleuser") - @Operation(summary = "Firebase Cloud로 메시지 요청(single user)") + @Operation(summary = "Firebase Cloud로 메시지 요청(single user) - 2401 [미리]") public ResponseEntity pushNotification(@RequestBody CreatePushNotificationRequest createPushNotificationRequest) throws FirebaseMessagingException{ fcmNotificationService.sendSingleUser(createPushNotificationRequest.getUserId(), @@ -29,7 +31,7 @@ public ResponseEntity pushNotification(@RequestBody CreatePushNotificati } @PostMapping("/push-notification-multipleuser") - @Operation(summary = "Firebase Cloud로 메시지 요청(multiple user)") + @Operation(summary = "Firebase Cloud로 메시지 요청(multiple user) - 2402 [미리]") public ResponseEntity pushNotificationToMultipleUser(@RequestBody CreateMultiplePushNotificationRequest createMultiplePushNotificationRequest) throws FirebaseMessagingException { diff --git a/src/main/java/com/climeet/climeet_backend/domain/followrelationship/FollowRelationshipController.java b/src/main/java/com/climeet/climeet_backend/domain/followrelationship/FollowRelationshipController.java index 42e6c0ec..96a8c9bd 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/followrelationship/FollowRelationshipController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/followrelationship/FollowRelationshipController.java @@ -25,7 +25,7 @@ public class FollowRelationshipController { private final FollowRelationshipService followRelationshipService; @PostMapping("/follow-relationship") - @Operation(summary = "유저 팔로우") + @Operation(summary = "유저 팔로우 - 2101 [미리]") @SwaggerApiError({ErrorStatus._EMPTY_USER, ErrorStatus._EXIST_FOLLOW_RELATIONSHIP}) public ResponseEntity followUser(@RequestParam Long followingUserId, @CurrentUser User currentUser) throws FirebaseMessagingException { @@ -35,7 +35,7 @@ public ResponseEntity followUser(@RequestParam Long followingUserId, @Cu } @DeleteMapping("/follow-relationship") - @Operation(summary = "유저 팔로우 취소") + @Operation(summary = "유저 팔로우 취소 - 2102 [미리]") @SwaggerApiError({ErrorStatus._EMPTY_USER, ErrorStatus._EXIST_FOLLOW_RELATIONSHIP}) public ResponseEntity unfollowUser(@RequestParam Long followingUserId, @CurrentUser User currentUser){ User following = followRelationshipService.findByUserId(followingUserId); @@ -44,7 +44,7 @@ public ResponseEntity unfollowUser(@RequestParam Long followingUserId, @ } @PostMapping("/follow-relationship/gym") - @Operation(summary = "암장 팔로우") + @Operation(summary = "암장 팔로우 - 2103 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EXIST_FOLLOW_RELATIONSHIP}) public ResponseEntity followGym(@RequestParam Long gymId, @CurrentUser User currentUser) throws FirebaseMessagingException { @@ -54,7 +54,7 @@ public ResponseEntity followGym(@RequestParam Long gymId, @CurrentUser U } @DeleteMapping("/follow-relationship/gym") - @Operation(summary = "암장 팔로우 취소") + @Operation(summary = "암장 팔로우 취소 - 2104 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EXIST_FOLLOW_RELATIONSHIP}) public ResponseEntity unfollowGym(@RequestParam Long gymId, @CurrentUser User currentUser){ User following = followRelationshipService.findManagerByGymID(gymId); diff --git a/src/main/java/com/climeet/climeet_backend/domain/manager/ManagerController.java b/src/main/java/com/climeet/climeet_backend/domain/manager/ManagerController.java index 0c095731..55929ed8 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/manager/ManagerController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/manager/ManagerController.java @@ -3,7 +3,9 @@ import com.climeet.climeet_backend.domain.manager.dto.ManagerRequestDto.CreateAccessTokenRequest; import com.climeet.climeet_backend.domain.manager.dto.ManagerRequestDto.CreateManagerRequest; import com.climeet.climeet_backend.domain.manager.dto.ManagerResponseDto.ManagerSimpleInfo; +import com.climeet.climeet_backend.domain.user.User; import com.climeet.climeet_backend.global.response.code.status.ErrorStatus; +import com.climeet.climeet_backend.global.security.CurrentUser; import com.climeet.climeet_backend.global.utils.SwaggerApiError; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -26,7 +28,7 @@ public class ManagerController { private final ManagerService managerService; @PostMapping("/login") - @Operation(summary = "관리자 로그인", description = "관리자 로그인") + @Operation(summary = "관리자 로그인 - 203 [미리]", description = "관리자 로그인") @SwaggerApiError({ErrorStatus._BAD_REQUEST, ErrorStatus._WRONG_LOGINID_PASSWORD}) public ResponseEntity login(@RequestBody CreateAccessTokenRequest createAccessTokenRequest){ @@ -35,7 +37,7 @@ public ResponseEntity login(@RequestBody } @PostMapping("/signup") - @Operation(summary = "관리자 회원가입", description = "**Enum 설명**\n\n**ServiceBitmask** : 샤워\\_시설, 샤워\\_용품, 수건\\_제공, 간이\\_세면대, 초크\\_대여, 암벽화\\_대여, 삼각대\\_대여, 운동복\\_대여") + @Operation(summary = "관리자 회원가입 - 204 [미리]", description = "**Enum 설명**\n\n**ServiceBitmask** : 샤워\\_시설, 샤워\\_용품, 수건\\_제공, 간이\\_세면대, 초크\\_대여, 암벽화\\_대여, 삼각대\\_대여, 운동복\\_대여") @SwaggerApiError({ErrorStatus._BAD_REQUEST, ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._DUPLICATE_LOGINID}) public ResponseEntity signUp(@RequestBody CreateManagerRequest createManagerRequest){ @@ -43,7 +45,7 @@ public ResponseEntity signUp(@RequestBody return ResponseEntity.ok("회원가입 완료. 승인 대기 중."); } - @Operation(summary = "암장 등록 중복 확인", description = "이미 관리자가 등록된 암장인지 확인하는 API \n\n **이미 관리자 등록 되어있음** : false \n\n **관리자 등록 안되어 있음** : true") + @Operation(summary = "암장 등록 중복 확인 - 202 [미리]", description = "이미 관리자가 등록된 암장인지 확인하는 API \n\n **이미 관리자 등록 되어있음** : false \n\n **관리자 등록 안되어 있음** : true") @GetMapping("/isRegistered/{gymId}") public ResponseEntity isRegistered(@PathVariable Long gymId){ boolean isRegistered = !managerService.checkManagerRegistration(gymId); @@ -52,13 +54,20 @@ public ResponseEntity isRegistered(@PathVariable Long gymId){ @GetMapping("/check-id/{loginId}") - @Operation(summary = "관리자 ID 중복 확인", description = "**이미 존재하는 ID** : false \n\n **사용 가능한 ID** : true") + @Operation(summary = "관리자 ID 중복 확인 - 201 [미리]", description = "**이미 존재하는 ID** : false \n\n **사용 가능한 ID** : true") public ResponseEntity checkLoginId(@PathVariable String loginId){ boolean isDuplicated = !managerService.checkLoginDuplication(loginId); return ResponseEntity.ok(isDuplicated); } + @GetMapping("/gym-id") + @Operation(summary = "관리자 관리 암장 확인. - 205 [무빗]", description = "관리자의 소속 암장 id를 확인합니다.") + @SwaggerApiError({ErrorStatus._EMPTY_MANAGER}) + public ResponseEntity getClimbingGymIdOfManager(@CurrentUser User user){ + return ResponseEntity.ok(managerService.getClimbingGymIdOfManager(user)); + } + } diff --git a/src/main/java/com/climeet/climeet_backend/domain/manager/ManagerService.java b/src/main/java/com/climeet/climeet_backend/domain/manager/ManagerService.java index b3e8ad60..dec066c7 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/manager/ManagerService.java +++ b/src/main/java/com/climeet/climeet_backend/domain/manager/ManagerService.java @@ -11,6 +11,7 @@ import com.climeet.climeet_backend.domain.manager.dto.ManagerRequestDto.CreateAccessTokenRequest; import com.climeet.climeet_backend.domain.manager.dto.ManagerRequestDto.CreateManagerRequest; import com.climeet.climeet_backend.domain.manager.dto.ManagerResponseDto.ManagerSimpleInfo; +import com.climeet.climeet_backend.domain.user.User; import com.climeet.climeet_backend.global.response.code.status.ErrorStatus; import com.climeet.climeet_backend.global.response.exception.GeneralException; import com.climeet.climeet_backend.global.security.JwtTokenProvider; @@ -114,6 +115,12 @@ public boolean checkLoginDuplication(String loginId){ return managerRepository.findByLoginId(loginId).isPresent(); } + public Long getClimbingGymIdOfManager(User user){ + Manager manager = managerRepository.findById(user.getId()) + .orElseThrow(() -> new GeneralException(ErrorStatus._EMPTY_MANAGER)); + return manager.getClimbingGym().getId(); + } + diff --git a/src/main/java/com/climeet/climeet_backend/domain/review/ReviewController.java b/src/main/java/com/climeet/climeet_backend/domain/review/ReviewController.java index 9b0554f5..f24f63fc 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/review/ReviewController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/review/ReviewController.java @@ -29,7 +29,7 @@ public class ReviewController { private final ReviewService reviewService; - @Operation(summary = "암장 리뷰 작성") + @Operation(summary = "암장 리뷰 작성 - 1401 [무빗]") @SwaggerApiError({ErrorStatus._RATING_OUT_OF_RANGE, ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_MANAGER_GYM, ErrorStatus._EMPTY_MEMBER, ErrorStatus._REVIEW_EXIST}) @PostMapping("/{gymId}/review") @@ -39,7 +39,7 @@ public ResponseEntity createReview( return ResponseEntity.ok("리뷰를 추가했습니다."); } - @Operation(summary = "특정 암장 리뷰 목록 조회") + @Operation(summary = "특정 암장 리뷰 목록 조회 - 1402 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_MANAGER_GYM, ErrorStatus._EMPTY_MEMBER}) @GetMapping("/{gymId}/review") @@ -50,7 +50,7 @@ public ResponseEntity> getReviewList( } - @Operation(summary = "암장 리뷰 수정") + @Operation(summary = "암장 리뷰 수정 - 1403 [무빗]") @SwaggerApiError({ErrorStatus._RATING_OUT_OF_RANGE, ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_MANAGER_GYM, ErrorStatus._EMPTY_MEMBER, ErrorStatus._EMPTY_REVIEW}) @PatchMapping("/{gymId}/review") diff --git a/src/main/java/com/climeet/climeet_backend/domain/review/ReviewRepository.java b/src/main/java/com/climeet/climeet_backend/domain/review/ReviewRepository.java index f6cf97f8..57ed7613 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/review/ReviewRepository.java +++ b/src/main/java/com/climeet/climeet_backend/domain/review/ReviewRepository.java @@ -9,8 +9,8 @@ public interface ReviewRepository extends JpaRepository { - Optional findByClimbingGymAndClimber(ClimbingGym climbingGym, Climber climber); + Optional findByClimbingGymAndClimberId(ClimbingGym climbingGym, Long userId); - Page findByClimbingGymAndClimberIsNotOrderByUpdatedAtDesc(ClimbingGym climbingGym, - Climber climber, Pageable pageable); + Page findByClimbingGymAndClimberIdIsNotOrderByUpdatedAtDesc(ClimbingGym climbingGym, + Long userId, Pageable pageable); } \ No newline at end of file diff --git a/src/main/java/com/climeet/climeet_backend/domain/review/ReviewService.java b/src/main/java/com/climeet/climeet_backend/domain/review/ReviewService.java index 4792072e..b4b22f52 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/review/ReviewService.java +++ b/src/main/java/com/climeet/climeet_backend/domain/review/ReviewService.java @@ -58,8 +58,8 @@ public void createReview(CreateReviewRequest createReviewRequest, User user, Lon .orElseThrow(() -> new GeneralException(ErrorStatus._EMPTY_MEMBER)); // 이미 작성된 리뷰가 있는지 확인 (1명의 유저는 1개의 암장에 1개의 리뷰만 가능) - Optional optionalReview = reviewRepository.findByClimbingGymAndClimber( - climbingGym, climber); + Optional optionalReview = reviewRepository.findByClimbingGymAndClimberId( + climbingGym, user.getId()); if (optionalReview.isPresent()) { throw new GeneralException(ErrorStatus._REVIEW_EXIST); } @@ -76,14 +76,11 @@ public PageResponseDto getReviewList(Long gymId, User ClimbingGym climbingGym = climbingGymRepository.findById(gymId) .orElseThrow(() -> new GeneralException(ErrorStatus._EMPTY_CLIMBING_GYM)); - Climber climber = climberRepository.findById(user.getId()) - .orElseThrow(() -> new GeneralException(ErrorStatus._EMPTY_MEMBER)); - ReviewSummaryResponse reviewSummaryResponse = null; if (page == FIRST_PAGE) { // 사용자 리뷰가 있으면 가져오고, 없으면 null을 myReview에 넣음 - Optional optionalReview = reviewRepository.findByClimbingGymAndClimber( - climbingGym, climber); + Optional optionalReview = reviewRepository.findByClimbingGymAndClimberId( + climbingGym, user.getId()); ReviewDetailResponse myReview = null; if (optionalReview.isPresent()) { myReview = ReviewDetailResponse.toDTO(optionalReview.get()); @@ -94,9 +91,9 @@ public PageResponseDto getReviewList(Long gymId, User Pageable pageable = PageRequest.of(page, size); - Slice reviewSlice = reviewRepository.findByClimbingGymAndClimberIsNotOrderByUpdatedAtDesc( + Slice reviewSlice = reviewRepository.findByClimbingGymAndClimberIdIsNotOrderByUpdatedAtDesc( climbingGym, - climber, pageable); + user.getId(), pageable); List reviewList = reviewSlice.stream() .map(review -> ReviewDetailResponse.toDTO(review)) @@ -124,8 +121,8 @@ public void changeReview(CreateReviewRequest changeReviewRequest, User user, Lon .orElseThrow(() -> new GeneralException(ErrorStatus._EMPTY_MEMBER)); // 리뷰 데이터 불러오기 - Review review = reviewRepository.findByClimbingGymAndClimber( - climbingGym, climber) + Review review = reviewRepository.findByClimbingGymAndClimberId( + climbingGym, user.getId()) .orElseThrow(() -> new GeneralException(ErrorStatus._EMPTY_REVIEW)); // 리뷰 추가로 인한 평균 리뷰 갱신 diff --git a/src/main/java/com/climeet/climeet_backend/domain/route/RouteController.java b/src/main/java/com/climeet/climeet_backend/domain/route/RouteController.java index 0fd8b168..bafb1956 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/route/RouteController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/route/RouteController.java @@ -29,7 +29,7 @@ public class RouteController { private final RouteService routeService; - @Operation(summary = "클라이밍 루트 생성") + @Operation(summary = "클라이밍 루트 생성 - 1601 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_SECTOR}) @PostMapping("/route") public ResponseEntity createRoute( @@ -39,7 +39,7 @@ public ResponseEntity createRoute( return ResponseEntity.ok(routeService.createRoute(createRouteRequest, routeImage, user)); } - @Operation(summary = "클라이밍 루트 조회") + @Operation(summary = "클라이밍 루트 조회 - 1602 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_ROUTE}) @GetMapping("/route/{routeId}") public ResponseEntity getRoute(@PathVariable Long routeId, @@ -47,7 +47,7 @@ public ResponseEntity getRoute(@PathVariable Long routeId, return ResponseEntity.ok(routeService.getRoute(routeId)); } - @Operation(summary = "클라이밍 암장 루트 목록 조회") + @Operation(summary = "클라이밍 암장 루트 목록 조회 - 1603 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_ROUTE_LIST}) @GetMapping("/{gymId}/routes") public ResponseEntity> getRouteList(@PathVariable Long gymId, diff --git a/src/main/java/com/climeet/climeet_backend/domain/routerecord/RouteRecordController.java b/src/main/java/com/climeet/climeet_backend/domain/routerecord/RouteRecordController.java index c917a072..cb0e11d4 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/routerecord/RouteRecordController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/routerecord/RouteRecordController.java @@ -31,14 +31,14 @@ public class RouteRecordController { //생성로직은 ClimbingRecordService에서 구현 - @Operation(summary = "루트 기록 전체 조회") + @Operation(summary = "루트 기록 전체 조회 - 101 [훈]") @GetMapping @SwaggerApiError({ErrorStatus._EMPTY_ROUTE_RECORD}) public ResponseEntity> getRouteRecordList(@CurrentUser User user) { return ResponseEntity.ok(routeRecordService.getRouteRecordList(user)); } - @Operation(summary = "루트 기록 id 조회") + @Operation(summary = "루트 기록 id 조회 - 102 [훈]") @GetMapping("/{id}") @SwaggerApiError({ErrorStatus._ROUTE_RECORD_NOT_FOUND, ErrorStatus._EMPTY_ROUTE, ErrorStatus._INVALID_MEMBER}) @@ -48,7 +48,7 @@ public ResponseEntity getRouteRecord( return ResponseEntity.ok(routeRecordService.getRouteRecord(user, id)); } - @Operation(summary = "RouteRecord 수정") + @Operation(summary = "RouteRecord 수정 - 104 [훈]") @PatchMapping("/{id}") @SwaggerApiError({ErrorStatus._ROUTE_RECORD_NOT_FOUND, ErrorStatus._INVALID_MEMBER}) public ResponseEntity updateRouteRecord( @@ -59,7 +59,7 @@ public ResponseEntity updateRouteRecord( routeRecordService.updateRouteRecord(user, id, updateRouteRecord)); } - @Operation(summary = "RouteRecord 삭제") + @Operation(summary = "RouteRecord 삭제 - 103 [훈]") @DeleteMapping("/{id}") @SwaggerApiError({ErrorStatus._ROUTE_RECORD_NOT_FOUND, ErrorStatus._INVALID_MEMBER}) public ResponseEntity deleteRouteRecord( diff --git a/src/main/java/com/climeet/climeet_backend/domain/routeversion/RouteVersionController.java b/src/main/java/com/climeet/climeet_backend/domain/routeversion/RouteVersionController.java index 2bf643c3..d7be1fcf 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/routeversion/RouteVersionController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/routeversion/RouteVersionController.java @@ -34,7 +34,7 @@ public class RouteVersionController { private final RouteVersionService routeVersionService; - @Operation(summary = "암장의 루트 버전 일자 목록") + @Operation(summary = "암장의 루트 버전 일자 목록 - 1102 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_VERSION_LIST}) @GetMapping("/{gymId}/version/list") public ResponseEntity> getRouteVersionList(@CurrentUser User user, @@ -43,7 +43,7 @@ public ResponseEntity> getRouteVersionList(@CurrentUser User use return ResponseEntity.ok(routeVersionList); } - @Operation(summary = "암장의 루트 버전 추가") + @Operation(summary = "암장의 루트 버전 추가 - 1104 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._DUPLICATE_ROUTE_VERSION, ErrorStatus._MISMATCH_ROUTE_IDS, ErrorStatus._MISMATCH_SECTOR_IDS}) @PostMapping("/version") @@ -54,7 +54,7 @@ public ResponseEntity createRouteVersion( return ResponseEntity.ok("루트 버전이 추가되었습니다."); } - @Operation(summary = "암장 특정 루트버전 필터링 키 불러오기", description = "timePoint 값은 비필수 값이며, 입력되지 않았을 때의 default는 오늘 날짜입니다.") + @Operation(summary = "암장 특정 루트버전 필터링 키 불러오기 - 1101 [무빗]", description = "timePoint 값은 비필수 값이며, 입력되지 않았을 때의 default는 오늘 날짜입니다.") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_VERSION, ErrorStatus._EMPTY_SECTOR_LIST, ErrorStatus._MISMATCH_SECTOR_IDS, ErrorStatus._EMPTY_DIFFICULTY_LIST}) @@ -69,7 +69,7 @@ public ResponseEntity getRouteVersionFiltering @Operation(summary = "암장 특정 루트버전 루트 리스트 불러오기 (필터링 포함)", description = "timePoint 값은 비필수 값이며, 입력되지 않았을 때의 default는 오늘 날짜입니다. \n 각 List 필터링 값 또한 비필수이며, 만약 특정 List에 필터링될 값이 없다면 입력하지 않아도 문제 없습니다.") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_VERSION, ErrorStatus._EMPTY_ROUTE_LIST, ErrorStatus._MISMATCH_ROUTE_IDS}) - @PostMapping("/{gymId}/version/route") + @PostMapping("/{gymId}/version/route - 1103 [무빗]") public ResponseEntity>> getRouteVersionFiltering( @CurrentUser User user, @PathVariable Long gymId, @RequestBody GetFilteredRouteVersionRequest getFilteredRouteVersionRequest) { diff --git a/src/main/java/com/climeet/climeet_backend/domain/sector/SectorController.java b/src/main/java/com/climeet/climeet_backend/domain/sector/SectorController.java index 42a932f1..6fdb718e 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/sector/SectorController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/sector/SectorController.java @@ -28,7 +28,7 @@ public class SectorController { private final SectorService sectorService; - @Operation(summary = "클라이밍 섹터 생성") + @Operation(summary = "클라이밍 섹터 생성 - 502 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_MANAGER, ErrorStatus._DUPLICATE_SECTOR_NAME}) @PostMapping("/sector") public ResponseEntity createSector( @@ -38,7 +38,7 @@ public ResponseEntity createSector( return ResponseEntity.ok(sectorService.createSector(createSectorRequest, sectorImage, user)); } - @Operation(summary = "특정 암장 전체 섹터 조회") + @Operation(summary = "특정 암장 전체 섹터 조회 - 501 [무빗]") @SwaggerApiError({ErrorStatus._EMPTY_SECTOR_LIST}) @GetMapping("/{gymId}/sector") public ResponseEntity> getSectorList( diff --git a/src/main/java/com/climeet/climeet_backend/domain/shorts/ShortsController.java b/src/main/java/com/climeet/climeet_backend/domain/shorts/ShortsController.java index c21ce4e0..1e7c9692 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/shorts/ShortsController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/shorts/ShortsController.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; -@Tag(name = "shorts", description = "숏츠 API") +@Tag(name = "Shorts", description = "숏츠 API") @RequiredArgsConstructor @RestController @RequestMapping("/api") @@ -35,7 +35,7 @@ public class ShortsController { @PostMapping("/shorts") @SwaggerApiError({ErrorStatus._EMPTY_CLIMBING_GYM, ErrorStatus._EMPTY_SECTOR, ErrorStatus._EMPTY_ROUTE}) - @Operation(summary = "숏츠 업로드", description = "**shortsVisibility** : PUBLIC OR FOLLOWERS_ONLY OR PRIVATE") + @Operation(summary = "숏츠 업로드 - 301 [진로]", description = "**shortsVisibility** : PUBLIC OR FOLLOWERS_ONLY OR PRIVATE") public ResponseEntity uploadShorts(@CurrentUser User user, @RequestPart(value = "video") MultipartFile video, @RequestPart CreateShortsRequest createShortsRequest) throws FirebaseMessagingException { @@ -44,7 +44,7 @@ public ResponseEntity uploadShorts(@CurrentUser User user, } @GetMapping("/shorts/latest") - @Operation(summary = "숏츠 최신순 조회", description = "gymId, sectorId, routeIds 미 입력시 전체 조회") + @Operation(summary = "숏츠 최신순 조회 - 305 [진로]", description = "gymId, sectorId, routeIds 미 입력시 전체 조회") public ResponseEntity>> findLatestShorts( @CurrentUser User user, @RequestParam int page, @RequestParam int size, @RequestParam(required = false) Long gymId, @RequestParam(required = false) Long sectorId, @@ -54,7 +54,7 @@ public ResponseEntity>> findLatestShorts( } @GetMapping("/shorts/popular") - @Operation(summary = "숏츠 인기순 조회", description = "gymId, sectorId, routeIds 미 입력시 전체 조회") + @Operation(summary = "숏츠 인기순 조회 - 307 [진로]", description = "gymId, sectorId, routeIds 미 입력시 전체 조회") public ResponseEntity>> findPopularShorts( @CurrentUser User user, @RequestParam int page, @RequestParam int size, @RequestParam(required = false) Long gymId, @RequestParam(required = false) Long sectorId, @@ -64,7 +64,7 @@ public ResponseEntity>> findPopularShorts } @PatchMapping("/shorts/{shortsId}/viewCount") - @Operation(summary = "숏츠 조회수 증가") + @Operation(summary = "숏츠 조회수 증가 - 303 [진로]") public ResponseEntity updateShortsViewCount(@CurrentUser User user, @PathVariable Long shortsId) { shortsService.updateShortsViewCount(user, shortsId); @@ -72,7 +72,7 @@ public ResponseEntity updateShortsViewCount(@CurrentUser User user, } @GetMapping("/shorts/profile") - @Operation(summary = "숏츠 프로필 바 조회", description = "팔로우 하고있는 암장, 프로필 리스트 조회/최근에 영상을 올렸을 시 true") + @Operation(summary = "숏츠 프로필 바 조회 - 308 [진로]", description = "팔로우 하고있는 암장, 프로필 리스트 조회/최근에 영상을 올렸을 시 true") public ResponseEntity> getShortsProfileList( @CurrentUser User user) { List shortsProfileSimpleInfoList = shortsService.getShortsProfileList( @@ -81,7 +81,7 @@ public ResponseEntity> getShortsProfileList( } @PatchMapping("/shorts/isRead") - @Operation(summary = "숏츠 프로필바 초록불 OFF 처리") + @Operation(summary = "숏츠 프로필바 초록불 OFF 처리 - 304 [진로]") @SwaggerApiError({ErrorStatus._EMPTY_FOLLOW_RELATIONSHIP}) public ResponseEntity updateShortsIsRead(@CurrentUser User user, @RequestParam Long followingUserId) { @@ -90,14 +90,14 @@ public ResponseEntity updateShortsIsRead(@CurrentUser User user, } @GetMapping("/shorts/{shortsId}") - @Operation(summary = "숏츠 단일 조회") + @Operation(summary = "숏츠 단일 조회 - 302 [진로]") @SwaggerApiError({ErrorStatus._EMPTY_SHORTS, ErrorStatus._SHORTS_ACCESS_DENIED}) public ResponseEntity findShorts(@CurrentUser User user, @PathVariable Long shortsId) { return ResponseEntity.ok(shortsService.findDetailShorts(user, shortsId)); } - @GetMapping("/shorts/uploader/{uploaderId}") + @GetMapping("/shorts/uploader/{uploaderId} - 309 [진로]") @Operation(summary = "특정 유저가 올린 숏츠 조회") @SwaggerApiError({ErrorStatus._EMPTY_USER}) public ResponseEntity>> findShortsByUserId(@CurrentUser User user, @@ -110,7 +110,7 @@ public ResponseEntity>> findShortsByUserI } @GetMapping("/shorts/my-shorts") - @Operation(summary = "내 숏츠 조회") + @Operation(summary = "내 숏츠 조회 - 306 [진로]") public ResponseEntity>> findShortsByLoginUser(@CurrentUser User user, @RequestParam ShortsVisibility shortsVisibility, @RequestParam int page, @RequestParam int size) { @@ -118,13 +118,13 @@ public ResponseEntity>> findShortsByLogin } @GetMapping("/shorts/user/liked") - @Operation(summary = "내가 좋아요 누른 숏츠 조회") + @Operation(summary = "내가 좋아요 누른 숏츠 조회 - 310 [진로]") public ResponseEntity>> findUserLikedShorts(@CurrentUser User user, @RequestParam int page, @RequestParam int size) { return ResponseEntity.ok(shortsService.findUserLikedShorts(user, page, size)); } - @Operation(summary = "내가 북마크 숏츠 조회") + @Operation(summary = "내가 북마크 숏츠 조회 - 311 [진로]") @GetMapping("/shorts/user/bookmarked") public ResponseEntity>> findUserBookmarkedShorts( @CurrentUser User user, diff --git a/src/main/java/com/climeet/climeet_backend/domain/shortsbookmark/ShortsBookmarkController.java b/src/main/java/com/climeet/climeet_backend/domain/shortsbookmark/ShortsBookmarkController.java index 1819be13..33251930 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/shortsbookmark/ShortsBookmarkController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/shortsbookmark/ShortsBookmarkController.java @@ -1,31 +1,28 @@ package com.climeet.climeet_backend.domain.shortsbookmark; -import com.climeet.climeet_backend.domain.shorts.ShortsService; -import com.climeet.climeet_backend.domain.shorts.dto.ShortsResponseDto.ShortsSimpleInfo; import com.climeet.climeet_backend.domain.user.User; -import com.climeet.climeet_backend.global.common.PageResponseDto; import com.climeet.climeet_backend.global.response.code.status.ErrorStatus; import com.climeet.climeet_backend.global.security.CurrentUser; import com.climeet.climeet_backend.global.utils.SwaggerApiError; import io.swagger.v3.oas.annotations.Operation; -import java.util.List; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @RequiredArgsConstructor @RestController @RequestMapping("/api") +@Tag(name = "ShortsBookmark") + public class ShortsBookmarkController { private final ShortsBookmarkService shortsBookmarkService; - @Operation(summary = "숏츠 북마크") + @Operation(summary = "숏츠 북마크 - 2501 [진로]") @SwaggerApiError({ErrorStatus._EMPTY_SHORTS}) @PatchMapping("/shorts/{shortsId}/bookmarks") public ResponseEntity createShortsBookmark( diff --git a/src/main/java/com/climeet/climeet_backend/domain/shortscomment/ShortsCommentController.java b/src/main/java/com/climeet/climeet_backend/domain/shortscomment/ShortsCommentController.java index 0a041599..bc4fd8ae 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/shortscomment/ShortsCommentController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/shortscomment/ShortsCommentController.java @@ -33,7 +33,7 @@ public class ShortsCommentController { private final ShortsCommentService shortsCommentService; - @Operation(summary = "숏츠 댓글 작성") + @Operation(summary = "숏츠 댓글 작성 - 1701 [진로]") @SwaggerApiError({ErrorStatus._EMPTY_SHORTS, ErrorStatus._EMPTY_SHORTS_COMMENT}) @PostMapping("/shorts/{shortsId}/shortsComments") public ResponseEntity createShortsComment( @@ -46,7 +46,7 @@ public ResponseEntity createShortsComment( parentCommentId, parentCommentId != null)); } - @Operation(summary = "숏츠 댓글 조회") + @Operation(summary = "숏츠 댓글 조회 - 1702 [진로]") @SwaggerApiError({ErrorStatus._EMPTY_SHORTS_COMMENT}) @GetMapping("/shorts/{shortsId}/shortsComments") public ResponseEntity>> findShortsCommentList( @@ -58,7 +58,7 @@ public ResponseEntity>> findSh shortsCommentService.findShortsCommentList(user, shortsId, page, size)); } - @Operation(summary = "숏츠 대댓글 조회") + @Operation(summary = "숏츠 대댓글 조회 - 1703 [진로]") @SwaggerApiError({ErrorStatus._EMPTY_SHORTS_COMMENT}) @GetMapping("/shorts/{shortsId}/{parentCommentId}") public ResponseEntity>> findShortsChildCommentList( @@ -71,7 +71,7 @@ public ResponseEntity>> findSho shortsCommentService.findShortsChildCommentList(user, shortsId, parentCommentId, page, size)); } - @Operation(summary = "숏츠 댓글 상호작용", description = "**shortsVisibility** : LIKE, DISLIKE, NONE") + @Operation(summary = "숏츠 댓글 상호작용 - 1704 [진로]", description = "**shortsVisibility** : LIKE, DISLIKE, NONE") @SwaggerApiError({ErrorStatus._EMPTY_SHORTS_COMMENT}) @PatchMapping("/shortsComments/{shortsCommentId}") public ResponseEntity changeShortsCommentLikeStatus( @@ -83,7 +83,7 @@ public ResponseEntity changeShortsCommentLikeStatus( isDislike)); } - @Operation(summary = "내가 작성한 숏츠 댓글 조회") + @Operation(summary = "내가 작성한 숏츠 댓글 조회 - 1705 [진로]") @GetMapping("/shorts/user/comments") public ResponseEntity>> findMyShortsComments( @CurrentUser User user, diff --git a/src/main/java/com/climeet/climeet_backend/domain/shortscomment/ShortsCommentService.java b/src/main/java/com/climeet/climeet_backend/domain/shortscomment/ShortsCommentService.java index 2089ffc0..bba1cab5 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/shortscomment/ShortsCommentService.java +++ b/src/main/java/com/climeet/climeet_backend/domain/shortscomment/ShortsCommentService.java @@ -198,6 +198,7 @@ public PageResponseDto> findMyShortsComments(User us List responseList = commentSlice.stream() .map(comment -> ShortsCommentResponse.builder() + .shortsId(comment.getShorts().getId()) .commentId(comment.getId()) .profileImageUrl(comment.getUser().getProfileImageUrl()) .content(comment.getContent()) diff --git a/src/main/java/com/climeet/climeet_backend/domain/shortscomment/dto/ShortsCommentResponseDto.java b/src/main/java/com/climeet/climeet_backend/domain/shortscomment/dto/ShortsCommentResponseDto.java index d7e0c6ea..fc2371c3 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/shortscomment/dto/ShortsCommentResponseDto.java +++ b/src/main/java/com/climeet/climeet_backend/domain/shortscomment/dto/ShortsCommentResponseDto.java @@ -85,13 +85,15 @@ public static ShortsCommentChildResponse toDTO(Long commentId, String nickname, @Getter @AllArgsConstructor public static class ShortsCommentResponse { + Long shortsId; Long commentId; String profileImageUrl; String content; String createdDate; - public static ShortsCommentResponse toDTO(Long commentId, String profileImageUrl, String content, String createdDate) { + public static ShortsCommentResponse toDTO(Long shortsId, Long commentId, String profileImageUrl, String content, String createdDate) { return ShortsCommentResponse.builder() + .shortsId(shortsId) .commentId(commentId) .profileImageUrl(profileImageUrl) .content(content) diff --git a/src/main/java/com/climeet/climeet_backend/domain/shortslike/ShortsLikeController.java b/src/main/java/com/climeet/climeet_backend/domain/shortslike/ShortsLikeController.java index cde0af46..adc1bb46 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/shortslike/ShortsLikeController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/shortslike/ShortsLikeController.java @@ -6,6 +6,7 @@ import com.climeet.climeet_backend.global.utils.SwaggerApiError; import com.google.firebase.messaging.FirebaseMessagingException; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PatchMapping; @@ -16,11 +17,12 @@ @RequiredArgsConstructor @RestController @RequestMapping("/api") +@Tag(name = "ShortsLike") public class ShortsLikeController { private final ShortsLikeService shortsLikeService; - @Operation(summary = "숏츠 좋아요") + @Operation(summary = "숏츠 좋아요 - 2601 [진로]") @SwaggerApiError({ErrorStatus._EMPTY_SHORTS}) @PatchMapping("/Shorts/{shortsId}/likes") public ResponseEntity changeShortsLikeStatus( diff --git a/src/main/java/com/climeet/climeet_backend/domain/user/UserController.java b/src/main/java/com/climeet/climeet_backend/domain/user/UserController.java index fb85cf73..9870e13e 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/user/UserController.java +++ b/src/main/java/com/climeet/climeet_backend/domain/user/UserController.java @@ -3,6 +3,7 @@ import com.climeet.climeet_backend.domain.user.dto.UserRequestDto.UpdateUserAllowNotificationRequest; import com.climeet.climeet_backend.domain.user.dto.UserRequestDto.UpdateUserFcmToken; import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserAccountDetailInfo; +import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserAllowNotificationInfo; import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserFollowDetailInfo; import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserFollowSimpleInfo; import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserHomeGymDetailInfo; @@ -36,7 +37,7 @@ public class UserController { private final UserService userService; @PostMapping("/refresh-token") - @Operation(summary = "소셜 Access token, Refresh token 재발급 ") + @Operation(summary = "소셜 Access token, Refresh token 재발급 - 2201 [미리]") @SwaggerApiError({ErrorStatus._INVALID_JWT, ErrorStatus._EXPIRED_JWT, ErrorStatus._INVALID_MEMBER}) public ResponseEntity refreshToken(@RequestParam String refreshToken){ return ResponseEntity.ok(userService.updateUserToken(refreshToken)); @@ -44,7 +45,7 @@ public ResponseEntity refreshToken(@RequestParam String ref } @GetMapping("/followers") - @Operation(summary = "특정 유저 팔로워 조회", description = "**userCategory** : Manager OR Climber\n\n 다른 사람의 팔로워를 조회하고 싶을 때 followingUserId를 채워서 보내고, 나 자신의 팔로워를 조회하고 싶을 때는 null로 보내면 됩니다.") + @Operation(summary = "특정 유저 팔로워 조회 - 2202 [미리]", description = "**userCategory** : Manager OR Climber\n\n 다른 사람의 팔로워를 조회하고 싶을 때 followingUserId를 채워서 보내고, 나 자신의 팔로워를 조회하고 싶을 때는 null로 보내면 됩니다.") @SwaggerApiError({ErrorStatus._BAD_REQUEST, ErrorStatus._EMPTY_USER}) public ResponseEntity> getFollower(@RequestParam(required = false) Long userId, @RequestParam String userCategory, @CurrentUser User currentUser){ return ResponseEntity.ok(userService.getFollower(userId, currentUser, userCategory)); @@ -52,7 +53,7 @@ public ResponseEntity> getFollower(@RequestParam(requ } @GetMapping("/followees") - @Operation(summary = "특정 유저 팔로잉 조회", description = "**userCategory** : Manager OR Climber\n\n 다른 사람의 팔로잉를 조회하고 싶을 때 followingUserId를 채워서 보내고, 나 자신의 팔로잉를 조회하고 싶을 때는 null로 보내면 됩니다.") + @Operation(summary = "특정 유저 팔로잉 조회 - 2203 [미리]", description = "**userCategory** : Manager OR Climber\n\n 다른 사람의 팔로잉를 조회하고 싶을 때 followingUserId를 채워서 보내고, 나 자신의 팔로잉를 조회하고 싶을 때는 null로 보내면 됩니다.") @SwaggerApiError({ErrorStatus._BAD_REQUEST, ErrorStatus._EMPTY_USER}) public ResponseEntity> getFollowing(@RequestParam(required = false) Long userId, @RequestParam String userCategory, @CurrentUser User currentUser){ return ResponseEntity.ok(userService.getFollowing(userId, currentUser, userCategory)); @@ -60,13 +61,13 @@ public ResponseEntity> getFollowing(@RequestParam(req } @GetMapping("/home/homegyms") - @Operation(summary = "홈 화면 홈짐 바로가기") + @Operation(summary = "홈 화면 홈짐 바로가기 - 2204 [미리]") public ResponseEntity> getHomeGyms(@CurrentUser User currentUser){ return ResponseEntity.ok(userService.getHomeGyms(currentUser)); } @GetMapping("/users/accounts") - @Operation(summary = "로그인 계정 정보 조회") + @Operation(summary = "로그인 계정 정보 조회 - 2205 [미리]") @SwaggerApiError({ErrorStatus._BAD_REQUEST, ErrorStatus._EMPTY_USER}) public ResponseEntity getLoginUserProfiles( @CurrentUser User currentUser) { @@ -74,7 +75,7 @@ public ResponseEntity getLoginUserProfiles( } @PatchMapping("/users/notifications") - @Operation(summary = "notificaion 허용 범위 수정") + @Operation(summary = "notificaion 허용 범위 수정 - 2206 [미리]") @SwaggerApiError({ErrorStatus._BAD_REQUEST, ErrorStatus._EMPTY_USER}) public ResponseEntity updateUserNotification(@CurrentUser User currentUser, @RequestBody UpdateUserAllowNotificationRequest updateRequestDto) { @@ -82,19 +83,19 @@ public ResponseEntity updateUserNotification(@CurrentUser User currentUs } @GetMapping("/climber-following") - @Operation(summary = "팔로우하는 클라이머 정보 조회(검색창 하단)") + @Operation(summary = "팔로우하는 클라이머 정보 조회(검색창 하단) - 2207 [미리]") public ResponseEntity> getClimberFollowing(@CurrentUser User currentUser){ return ResponseEntity.ok(userService.getClimberFollowing(currentUser)); } @GetMapping("/gym-following") - @Operation(summary = "팔로우하는 암장 정보 조회(검색창 하단)") + @Operation(summary = "팔로우하는 암장 정보 조회(검색창 하단) - 2208 [미리]") public ResponseEntity> getGymsFollowing(@CurrentUser User currentUser){ return ResponseEntity.ok(userService.getGymsFollowing(currentUser)); } @PostMapping("/users/fcmToken") - @Operation(summary = "사용자 FCM 토큰 업데이트") + @Operation(summary = "사용자 FCM 토큰 업데이트 - 2209 [미리]") public ResponseEntity updateFcmToken(@CurrentUser User currentUser, @RequestBody UpdateUserFcmToken updateUserFcmToken){ userService.updateUserFcmToken(currentUser, updateUserFcmToken.getFcmToken()); @@ -103,26 +104,26 @@ public ResponseEntity updateFcmToken(@CurrentUser User currentUser, @Req @GetMapping("/profile") @SwaggerApiError({ErrorStatus._EMPTY_USER}) - @Operation(summary = "마이페이지 유저 프로필 조회") + @Operation(summary = "마이페이지 유저 프로필 조회 - 2210 [미리]") public ResponseEntity getUserMyPageProfile(@CurrentUser User currentUser){ return ResponseEntity.ok(userService.getUserMyPageProfile(currentUser)); } @GetMapping("/profile/{userId}") @SwaggerApiError({ErrorStatus._EMPTY_USER}) - @Operation(summary = "특정 유저 프로필 조회") + @Operation(summary = "특정 유저 프로필 조회 - 2211 [미리]") public ResponseEntity getUserMyPageProfile(@CurrentUser User currentUser, @PathVariable Long userId){ return ResponseEntity.ok(userService.getOtherUserMyPageProfile(currentUser, userId)); } @GetMapping("/home/homegyms/{userId}") - @Operation(summary = "특정 유저 홈짐 조회") + @Operation(summary = "특정 유저 홈짐 조회 - 2212 [미리]") public ResponseEntity> getHomeGyms(@CurrentUser User currentUser, @PathVariable Long userId){ return ResponseEntity.ok(userService.getUserHomeGyms(userId)); } @PatchMapping("/profile-image") - @Operation(summary = "유저 프로필 사진 업데이트") + @Operation(summary = "유저 프로필 사진 업데이트 - 2213 [미리]") public ResponseEntity updateUserProfileImage(@CurrentUser User currentUser, @RequestPart MultipartFile image){ userService.updateUserProfileImage(currentUser, image); @@ -130,11 +131,18 @@ public ResponseEntity updateUserProfileImage(@CurrentUser User currentUs } @PatchMapping("/profile-name") - @Operation(summary = "유저 프로필 이름 업데이트") + @Operation(summary = "유저 프로필 이름 업데이트 - 2214 [미리]") public ResponseEntity updateUserProfileName(@CurrentUser User currentUser, @RequestParam String name){ userService.updateUserProfileName(currentUser, name); return ResponseEntity.ok("프로필 이름 업데이트 완료"); } + + @GetMapping("/users/notifications") + @Operation(summary = "유저 알림 허용 범위 조회 - 2215 [미리]") + public ResponseEntity getUserNotification(@CurrentUser User currentUser){ + return ResponseEntity.ok(userService.getUserNotification(currentUser)); + } + // @PostMapping("/master-token") // public String createMasterToken(){ // return userService.createMasterToken(); diff --git a/src/main/java/com/climeet/climeet_backend/domain/user/UserService.java b/src/main/java/com/climeet/climeet_backend/domain/user/UserService.java index b874b3e4..f79419db 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/user/UserService.java +++ b/src/main/java/com/climeet/climeet_backend/domain/user/UserService.java @@ -13,6 +13,7 @@ import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserAccountDetailInfo; import com.climeet.climeet_backend.domain.route.Route; import com.climeet.climeet_backend.domain.routeversion.RouteVersionService; +import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserAllowNotificationInfo; import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserFollowDetailInfo; import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserFollowSimpleInfo; import com.climeet.climeet_backend.domain.user.dto.UserResponseDto.UserHomeGymDetailInfo; @@ -311,6 +312,11 @@ public boolean checkProfileNameDuplication(String name) { return userRepository.findByprofileName(name).isPresent(); } + + public UserAllowNotificationInfo getUserNotification(User user){ + return UserAllowNotificationInfo.toDTO(user); + } + // public String createMasterToken(){ // return jwtTokenProvider.createToken("1+master", 0); // } diff --git a/src/main/java/com/climeet/climeet_backend/domain/user/dto/UserResponseDto.java b/src/main/java/com/climeet/climeet_backend/domain/user/dto/UserResponseDto.java index 2a0f76a8..9de8f269 100644 --- a/src/main/java/com/climeet/climeet_backend/domain/user/dto/UserResponseDto.java +++ b/src/main/java/com/climeet/climeet_backend/domain/user/dto/UserResponseDto.java @@ -206,4 +206,24 @@ public static UserProfileDetailInfo toDTO(User user, Boolean isManager){ } } + + @Getter + @AllArgsConstructor + @NoArgsConstructor + @Builder + public static class UserAllowNotificationInfo{ + private Boolean isAllowFollowNotification; + private Boolean isAllowLikeNotification; + private Boolean isAllowCommentNotification; + private Boolean isAllowAdNotification; + + public static UserAllowNotificationInfo toDTO(User user){ + return UserAllowNotificationInfo.builder() + .isAllowFollowNotification(user.getIsAllowFollowNotification()) + .isAllowLikeNotification(user.getIsAllowLikeNotification()) + .isAllowCommentNotification(user.getIsAllowCommentNotification()) + .isAllowAdNotification(user.getIsAllowAdNotification()) + .build(); + } + } } diff --git a/src/main/java/com/climeet/climeet_backend/global/s3/S3Controller.java b/src/main/java/com/climeet/climeet_backend/global/s3/S3Controller.java index 6b84cac0..9e09483d 100644 --- a/src/main/java/com/climeet/climeet_backend/global/s3/S3Controller.java +++ b/src/main/java/com/climeet/climeet_backend/global/s3/S3Controller.java @@ -3,6 +3,8 @@ import com.climeet.climeet_backend.global.response.code.status.ErrorStatus; import com.climeet.climeet_backend.global.response.exception.GeneralException; import com.climeet.climeet_backend.global.s3.dto.S3Result; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; @@ -13,26 +15,28 @@ @RequiredArgsConstructor @RestController +@Tag(name = "S3") public class S3Controller { private final S3Service s3Service; @PostMapping("api/file") + @Operation(summary = "2301 [진로]") public ResponseEntity uploadFile(@RequestPart(value = "file") MultipartFile file) { try { S3Result result = s3Service.uploadFile(file); return ResponseEntity.ok(result); - } - catch (Exception e) { + } catch (Exception e) { throw new GeneralException(ErrorStatus._FILE_UPLOAD_ERROR); } - }@PostMapping("api/retool/file") + } + + @PostMapping("api/retool/file") public ResponseEntity uploadRetoolFile(@RequestParam("file") MultipartFile file) { try { S3Result result = s3Service.uploadFile(file); return ResponseEntity.ok(result); - } - catch (Exception e) { + } catch (Exception e) { throw new GeneralException(ErrorStatus._FILE_UPLOAD_ERROR); } }