From 99c8dfcc8c6f6b008e4683a97b486eecd591f49b Mon Sep 17 00:00:00 2001 From: kseysh Date: Thu, 14 Nov 2024 13:49:34 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[feat]=20MeetingResponse=20=EC=A0=95?= =?UTF-8?q?=EC=9D=98=20(#431)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/meeting/MeetingCategory.java | 6 ++ .../application/meeting/MeetingResponse.java | 68 +++++++++++++++++++ .../application/meeting/MeetingStatus.java | 8 +++ 3 files changed, 82 insertions(+) create mode 100644 src/main/java/org/sopt/app/application/meeting/MeetingCategory.java create mode 100644 src/main/java/org/sopt/app/application/meeting/MeetingResponse.java create mode 100644 src/main/java/org/sopt/app/application/meeting/MeetingStatus.java diff --git a/src/main/java/org/sopt/app/application/meeting/MeetingCategory.java b/src/main/java/org/sopt/app/application/meeting/MeetingCategory.java new file mode 100644 index 00000000..a3b5f621 --- /dev/null +++ b/src/main/java/org/sopt/app/application/meeting/MeetingCategory.java @@ -0,0 +1,6 @@ +package org.sopt.app.application.meeting; + +public enum MeetingCategory { + STUDY, + EVENT +} diff --git a/src/main/java/org/sopt/app/application/meeting/MeetingResponse.java b/src/main/java/org/sopt/app/application/meeting/MeetingResponse.java new file mode 100644 index 00000000..039226c6 --- /dev/null +++ b/src/main/java/org/sopt/app/application/meeting/MeetingResponse.java @@ -0,0 +1,68 @@ +package org.sopt.app.application.meeting; + +import lombok.Builder; + +@Builder +public record MeetingResponse( + Long meetingId, + String title, + MeetingCategory category, + MeetingStatus status, + String imageUrl, + Boolean canJoinOnlyActiveGeneration +) { + public static MeetingResponse eventActiveDummy() { + return MeetingResponse.builder() + .meetingId(1L) + .title("[35기 솝커톤] 서버 파트 신청") + .category(MeetingCategory.EVENT) + .status(MeetingStatus.ACTIVE) + .imageUrl("https://makers-web-img.s3.ap-northeast-2.amazonaws.com/meeting/2024/11/14/78d48e33-f1d7-474f-a357-117b75a8cb90.png") + .canJoinOnlyActiveGeneration(false) + .build(); + } + + public static MeetingResponse studyRecruitingDummy() { + return MeetingResponse.builder() + .meetingId(2L) + .title("모집중이고 활동 기수만 참여하는 스터디") + .category(MeetingCategory.STUDY) + .status(MeetingStatus.RECRUITING) + .imageUrl("https://makers-web-img.s3.ap-northeast-2.amazonaws.com/meeting/2024/11/14/78d48e33-f1d7-474f-a357-117b75a8cb90.png") + .canJoinOnlyActiveGeneration(true) + .build(); + } + + public static MeetingResponse studyPreRecruitingDummy() { + return MeetingResponse.builder() + .meetingId(3L) + .title("모집 이전이고 모든 기수가 참여하는 스터디") + .category(MeetingCategory.STUDY) + .status(MeetingStatus.PRE_RECRUITING) + .imageUrl("https://makers-web-img.s3.ap-northeast-2.amazonaws.com/meeting/2024/11/14/78d48e33-f1d7-474f-a357-117b75a8cb90.png") + .canJoinOnlyActiveGeneration(false) + .build(); + } + + public static MeetingResponse studyClosedDummy() { + return MeetingResponse.builder() + .meetingId(4L) + .title("모집이 끝나고 모든 기수가 참여하는 스터디") + .category(MeetingCategory.STUDY) + .status(MeetingStatus.CLOSED) + .imageUrl("https://makers-web-img.s3.ap-northeast-2.amazonaws.com/meeting/2024/11/14/78d48e33-f1d7-474f-a357-117b75a8cb90.png") + .canJoinOnlyActiveGeneration(false) + .build(); + } + + public static MeetingResponse studyActiveDummy() { + return MeetingResponse.builder() + .meetingId(5L) + .title("활동중이고 활동 기수만 참여하는 스터디") + .category(MeetingCategory.STUDY) + .status(MeetingStatus.ACTIVE) + .imageUrl("https://makers-web-img.s3.ap-northeast-2.amazonaws.com/meeting/2024/11/14/78d48e33-f1d7-474f-a357-117b75a8cb90.png") + .canJoinOnlyActiveGeneration(true) + .build(); + } +} diff --git a/src/main/java/org/sopt/app/application/meeting/MeetingStatus.java b/src/main/java/org/sopt/app/application/meeting/MeetingStatus.java new file mode 100644 index 00000000..a795d1d6 --- /dev/null +++ b/src/main/java/org/sopt/app/application/meeting/MeetingStatus.java @@ -0,0 +1,8 @@ +package org.sopt.app.application.meeting; + +public enum MeetingStatus { + RECRUITING, + PRE_RECRUITING, + CLOSED, + ACTIVE +} From 7c109f7b95e74bafd81530fabed90bf758f48f2a Mon Sep 17 00:00:00 2001 From: kseysh Date: Thu, 14 Nov 2024 14:01:26 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[feat]=20dummy=20api=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20(~=ED=81=AC=EB=A3=A8=20api=EB=A5=BC=20?= =?UTF-8?q?=EB=B0=9B=EC=9D=84=20=EB=95=8C=EA=B9=8C=EC=A7=80)=20(#431)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/meeting/MeetingResponse.java | 25 +++++++++------- .../app/presentation/home/HomeController.java | 30 +++++++++++++++++++ 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/sopt/app/application/meeting/MeetingResponse.java b/src/main/java/org/sopt/app/application/meeting/MeetingResponse.java index 039226c6..2d205a5d 100644 --- a/src/main/java/org/sopt/app/application/meeting/MeetingResponse.java +++ b/src/main/java/org/sopt/app/application/meeting/MeetingResponse.java @@ -11,9 +11,10 @@ public record MeetingResponse( String imageUrl, Boolean canJoinOnlyActiveGeneration ) { - public static MeetingResponse eventActiveDummy() { + @Deprecated + public static MeetingResponse eventActiveDummy(Long id) { return MeetingResponse.builder() - .meetingId(1L) + .meetingId(id) .title("[35기 솝커톤] 서버 파트 신청") .category(MeetingCategory.EVENT) .status(MeetingStatus.ACTIVE) @@ -22,9 +23,10 @@ public static MeetingResponse eventActiveDummy() { .build(); } - public static MeetingResponse studyRecruitingDummy() { + @Deprecated + public static MeetingResponse studyRecruitingDummy(Long id) { return MeetingResponse.builder() - .meetingId(2L) + .meetingId(id) .title("모집중이고 활동 기수만 참여하는 스터디") .category(MeetingCategory.STUDY) .status(MeetingStatus.RECRUITING) @@ -33,9 +35,10 @@ public static MeetingResponse studyRecruitingDummy() { .build(); } - public static MeetingResponse studyPreRecruitingDummy() { + @Deprecated + public static MeetingResponse studyPreRecruitingDummy(Long id) { return MeetingResponse.builder() - .meetingId(3L) + .meetingId(id) .title("모집 이전이고 모든 기수가 참여하는 스터디") .category(MeetingCategory.STUDY) .status(MeetingStatus.PRE_RECRUITING) @@ -44,9 +47,10 @@ public static MeetingResponse studyPreRecruitingDummy() { .build(); } - public static MeetingResponse studyClosedDummy() { + @Deprecated + public static MeetingResponse studyClosedDummy(Long id) { return MeetingResponse.builder() - .meetingId(4L) + .meetingId(id) .title("모집이 끝나고 모든 기수가 참여하는 스터디") .category(MeetingCategory.STUDY) .status(MeetingStatus.CLOSED) @@ -55,9 +59,10 @@ public static MeetingResponse studyClosedDummy() { .build(); } - public static MeetingResponse studyActiveDummy() { + @Deprecated + public static MeetingResponse studyActiveDummy(Long id) { return MeetingResponse.builder() - .meetingId(5L) + .meetingId(id) .title("활동중이고 활동 기수만 참여하는 스터디") .category(MeetingCategory.STUDY) .status(MeetingStatus.ACTIVE) diff --git a/src/main/java/org/sopt/app/presentation/home/HomeController.java b/src/main/java/org/sopt/app/presentation/home/HomeController.java index 23f1ee75..0aceec97 100644 --- a/src/main/java/org/sopt/app/presentation/home/HomeController.java +++ b/src/main/java/org/sopt/app/presentation/home/HomeController.java @@ -8,6 +8,7 @@ import java.util.List; import lombok.RequiredArgsConstructor; import org.sopt.app.application.app_service.dto.AppServiceEntryStatusResponse; +import org.sopt.app.application.meeting.MeetingResponse; import org.sopt.app.domain.entity.User; import org.sopt.app.facade.HomeFacade; import org.springframework.http.ResponseEntity; @@ -51,4 +52,33 @@ public ResponseEntity> getAppService( homeFacade.checkAppServiceEntryStatus(user) ); } + + @Operation(summary = "전체 모임 확인") + @ApiResponses({ + @ApiResponse(responseCode = "200", description = "success"), + @ApiResponse(responseCode = "401", description = "token error", content = @Content), + @ApiResponse(responseCode = "500", description = "server error", content = @Content) + }) + @GetMapping("/meeting/all") + public ResponseEntity> getAllMeeting( + @AuthenticationPrincipal User user, + @RequestParam(value = "page") final int page, + @RequestParam(value = "take") final int take, + @RequestParam(value = "category") final String category + ) { + return ResponseEntity.ok( + List.of( + MeetingResponse.eventActiveDummy(1L), + MeetingResponse.studyRecruitingDummy(2L), + MeetingResponse.studyPreRecruitingDummy(3L), + MeetingResponse.studyClosedDummy(4L), + MeetingResponse.studyActiveDummy(5L), + MeetingResponse.eventActiveDummy(6L), + MeetingResponse.studyRecruitingDummy(7L), + MeetingResponse.studyPreRecruitingDummy(8L), + MeetingResponse.studyClosedDummy(9L), + MeetingResponse.studyActiveDummy(10L) + ) + ); + } }