Skip to content

Commit

Permalink
[FEAT] 전체 모임 확인 dummy api 추가 (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
kseysh authored Nov 14, 2024
2 parents 06ce26a + 27b39dd commit 94672ab
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.sopt.app.application.meeting;

public enum MeetingCategory {
STUDY,
EVENT
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
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
) {
@Deprecated
public static MeetingResponse eventActiveDummy(Long id) {
return MeetingResponse.builder()
.meetingId(id)
.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();
}

@Deprecated
public static MeetingResponse studyRecruitingDummy(Long id) {
return MeetingResponse.builder()
.meetingId(id)
.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();
}

@Deprecated
public static MeetingResponse studyPreRecruitingDummy(Long id) {
return MeetingResponse.builder()
.meetingId(id)
.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();
}

@Deprecated
public static MeetingResponse studyClosedDummy(Long id) {
return MeetingResponse.builder()
.meetingId(id)
.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();
}

@Deprecated
public static MeetingResponse studyActiveDummy(Long id) {
return MeetingResponse.builder()
.meetingId(id)
.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();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.sopt.app.application.meeting;

public enum MeetingStatus {
RECRUITING,
PRE_RECRUITING,
CLOSED,
ACTIVE
}
30 changes: 30 additions & 0 deletions src/main/java/org/sopt/app/presentation/home/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.sopt.app.presentation.home.response.EmploymentPostResponse;
Expand Down Expand Up @@ -67,4 +68,33 @@ public ResponseEntity<List<EmploymentPostResponse>> getEmploymentPosts(
homeFacade.getHomeEmploymentPost(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<List<MeetingResponse>> 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)
)
);
}
}

0 comments on commit 94672ab

Please sign in to comment.