From 6542937fc6ac7d5c259f7d6703ae643b3a207be1 Mon Sep 17 00:00:00 2001 From: Mingyu Song <100754581+mikekks@users.noreply.github.com> Date: Sun, 17 Nov 2024 16:01:03 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20APP=20BE=20=EC=99=80=EC=9D=98=20?= =?UTF-8?q?=ED=86=B5=EC=8B=A0=EC=9D=84=20=EC=9C=84=ED=95=9C=20=EB=AA=A8?= =?UTF-8?q?=EC=9E=84=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20API=20?= =?UTF-8?q?=EA=B0=9C=EB=B0=9C=20(#486)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * move(external): 알림 관련 기능 internal -> external 로 변경 * chore(Meeting): getMeetingStatusValue 과 getMeetingStatus 메서드 분리 * style(PageOptionsDto): 코드 배치 수정 * chore(SecurityConfig): internal 기능 화이트리스트에 추가 * add(Dto): Dto 추가 * feat(InternalMeetingController): 모임 목록 조회 컨트롤러 구현 * feat(InternalMeetingService): 모임 목록 조회 서비스 로직 구현 * rename(AdvertisementCustomPageable): 기존에 있던 CustomPageable -> AdvertisementCustomPageable 로 이름 변경 * feat(CustomPageable): CustomPageable 구현 및 적용 * fix(CustomPageable): take -> size 수정 * fix: 3항 연산자 -> if 문으로 수정 * docs(InternalMeetingGetAllMeetingQueryDto): 스웨거 설명 추가 * fix(InternalMeetingController): requestBody -> requestParam 변경 * docs(InternalMeetingApi): 스웨거 추가 * docs(AdvertisementCustomPageable): javadoc 추가 * chore: getBlockedUsers 기존 메서드 수정 --- .../v2/service/CommentV2ServiceImpl.java | 16 ++-- .../crew/main/entity/meeting/Meeting.java | 13 +-- .../entity/meeting/enums/EnMeetingStatus.java | 37 ++++---- .../notification/PushNotificationEnums.java | 2 +- .../PushNotificationServerClient.java | 6 +- .../notification/PushNotificationService.java | 7 +- .../dto/PushNotificationRequestDto.java | 2 +- .../dto/PushNotificationResponseDto.java | 2 +- .../service/MemberBlockService.java | 2 - .../service/MemberBlockServiceImpl.java | 8 -- .../main/global/config/SecurityConfig.java | 2 +- .../main/global/dto/MeetingResponseDto.java | 2 +- .../global/pagination/dto/PageOptionsDto.java | 22 ++--- .../util/AdvertisementCustomPageable.java | 85 +++++++++++++++++++ .../crew/main/global/util/CustomPageable.java | 30 +++---- .../main/internal/InternalMeetingApi.java | 34 ++++++++ .../internal/InternalMeetingController.java | 31 +++++++ .../dto/InternalMeetingGetAllMeetingDto.java | 22 +++++ .../InternalMeetingGetAllMeetingQueryDto.java | 23 +++++ .../dto/InternalMeetingResponseDto.java | 34 ++++++++ .../internal/dto/UserOrgIdRequestDto.java | 11 +++ .../service/InternalMeetingService.java | 67 +++++++++++++++ .../MeetingV2GetMeetingBannerResponseDto.java | 2 +- .../MeetingV2GetMeetingByIdResponseDto.java | 2 +- .../v2/service/MeetingV2ServiceImpl.java | 4 +- .../post/v2/service/PostV2ServiceImpl.java | 10 +-- ...gV2GetCreatedMeetingByUserResponseDto.java | 3 +- .../crew/main/entity/meeting/MeetingTest.java | 10 +-- 28 files changed, 393 insertions(+), 96 deletions(-) rename main/src/main/java/org/sopt/makers/crew/main/{internal => external}/notification/PushNotificationEnums.java (92%) rename main/src/main/java/org/sopt/makers/crew/main/{internal => external}/notification/PushNotificationServerClient.java (80%) rename main/src/main/java/org/sopt/makers/crew/main/{internal => external}/notification/PushNotificationService.java (72%) rename main/src/main/java/org/sopt/makers/crew/main/{internal => external}/notification/dto/PushNotificationRequestDto.java (82%) rename main/src/main/java/org/sopt/makers/crew/main/{internal => external}/notification/dto/PushNotificationResponseDto.java (85%) create mode 100644 main/src/main/java/org/sopt/makers/crew/main/global/util/AdvertisementCustomPageable.java create mode 100644 main/src/main/java/org/sopt/makers/crew/main/internal/InternalMeetingApi.java create mode 100644 main/src/main/java/org/sopt/makers/crew/main/internal/InternalMeetingController.java create mode 100644 main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingGetAllMeetingDto.java create mode 100644 main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingGetAllMeetingQueryDto.java create mode 100644 main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingResponseDto.java create mode 100644 main/src/main/java/org/sopt/makers/crew/main/internal/dto/UserOrgIdRequestDto.java create mode 100644 main/src/main/java/org/sopt/makers/crew/main/internal/service/InternalMeetingService.java diff --git a/main/src/main/java/org/sopt/makers/crew/main/comment/v2/service/CommentV2ServiceImpl.java b/main/src/main/java/org/sopt/makers/crew/main/comment/v2/service/CommentV2ServiceImpl.java index 9d5478b4..228d5541 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/comment/v2/service/CommentV2ServiceImpl.java +++ b/main/src/main/java/org/sopt/makers/crew/main/comment/v2/service/CommentV2ServiceImpl.java @@ -1,8 +1,8 @@ package org.sopt.makers.crew.main.comment.v2.service; -import static org.sopt.makers.crew.main.internal.notification.PushNotificationEnums.NEW_COMMENT_MENTION_PUSH_NOTIFICATION_TITLE; -import static org.sopt.makers.crew.main.internal.notification.PushNotificationEnums.NEW_COMMENT_PUSH_NOTIFICATION_TITLE; -import static org.sopt.makers.crew.main.internal.notification.PushNotificationEnums.PUSH_NOTIFICATION_CATEGORY; +import static org.sopt.makers.crew.main.external.notification.PushNotificationEnums.NEW_COMMENT_MENTION_PUSH_NOTIFICATION_TITLE; +import static org.sopt.makers.crew.main.external.notification.PushNotificationEnums.NEW_COMMENT_PUSH_NOTIFICATION_TITLE; +import static org.sopt.makers.crew.main.external.notification.PushNotificationEnums.PUSH_NOTIFICATION_CATEGORY; import java.util.ArrayList; import java.util.HashMap; @@ -42,8 +42,8 @@ import org.sopt.makers.crew.main.entity.user.User; import org.sopt.makers.crew.main.entity.user.UserRepository; import org.sopt.makers.crew.main.external.playground.service.MemberBlockService; -import org.sopt.makers.crew.main.internal.notification.PushNotificationService; -import org.sopt.makers.crew.main.internal.notification.dto.PushNotificationRequestDto; +import org.sopt.makers.crew.main.external.notification.PushNotificationService; +import org.sopt.makers.crew.main.external.notification.dto.PushNotificationRequestDto; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -174,7 +174,11 @@ public CommentV2GetCommentsResponseDto getComments(Integer postId, Integer page, User user = userRepository.findByIdOrThrow(userId); Long orgId = user.getOrgId().longValue(); - Map blockedUsers = memberBlockService.getBlockedUsers(orgId); + List userOrgIds = comments.stream() + .map(comment -> comment.getUser().getOrgId().longValue()) + .toList(); + + Map blockedUsers = memberBlockService.getBlockedUsers(orgId, userOrgIds); MyLikes myLikes = new MyLikes(likeRepository.findAllByUserIdAndCommentIdNotNull(userId)); diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/meeting/Meeting.java b/main/src/main/java/org/sopt/makers/crew/main/entity/meeting/Meeting.java index 7ecb0b5e..2120c58f 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/entity/meeting/Meeting.java +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/meeting/Meeting.java @@ -8,7 +8,6 @@ import jakarta.persistence.Column; import jakarta.persistence.Convert; import jakarta.persistence.Entity; -import jakarta.persistence.EntityListeners; import jakarta.persistence.FetchType; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; @@ -36,7 +35,6 @@ import org.sopt.makers.crew.main.entity.meeting.enums.MeetingJoinablePart; import org.sopt.makers.crew.main.entity.meeting.vo.ImageUrlVO; import org.sopt.makers.crew.main.entity.user.User; -import org.springframework.data.jpa.domain.support.AuditingEntityListener; @Entity @Getter @@ -201,14 +199,17 @@ public Meeting(User user, Integer userId, String title, MeetingCategory category * * @return 모임 모집상태 */ - public Integer getMeetingStatus(LocalDateTime now) { + public Integer getMeetingStatusValue(LocalDateTime now) { + return getMeetingStatus(now).getValue(); + } + public EnMeetingStatus getMeetingStatus(LocalDateTime now) { if (now.isBefore(startDate)) { - return EnMeetingStatus.BEFORE_START.getValue(); + return EnMeetingStatus.BEFORE_START; } else if (now.isBefore(endDate)) { - return EnMeetingStatus.APPLY_ABLE.getValue(); + return EnMeetingStatus.APPLY_ABLE; } else { - return EnMeetingStatus.RECRUITMENT_COMPLETE.getValue(); + return EnMeetingStatus.RECRUITMENT_COMPLETE; } } diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/meeting/enums/EnMeetingStatus.java b/main/src/main/java/org/sopt/makers/crew/main/entity/meeting/enums/EnMeetingStatus.java index 1eea7870..5886e080 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/entity/meeting/enums/EnMeetingStatus.java +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/meeting/enums/EnMeetingStatus.java @@ -1,32 +1,33 @@ package org.sopt.makers.crew.main.entity.meeting.enums; import java.util.Arrays; + import org.sopt.makers.crew.main.global.exception.BadRequestException; /** 모임 상태 */ public enum EnMeetingStatus { - /** 시작 전 */ - BEFORE_START(0), + /** 시작 전 */ + BEFORE_START(0), - /** 지원 가능 */ - APPLY_ABLE(1), + /** 지원 가능 */ + APPLY_ABLE(1), - /** 모집 완료 */ - RECRUITMENT_COMPLETE(2); + /** 모집 완료 */ + RECRUITMENT_COMPLETE(2); - private final int value; + private final int value; - EnMeetingStatus(int value) { - this.value = value; - } + EnMeetingStatus(int value) { + this.value = value; + } - public static EnMeetingStatus ofValue(int dbData) { - return Arrays.stream(EnMeetingStatus.values()).filter(v -> v.getValue() == (dbData)).findFirst() - .orElseThrow(() -> new BadRequestException( - String.format("EnMeetingStatus 클래스에 value = [%s] 값을 가진 enum 객체가 없습니다.", dbData))); - } + public static EnMeetingStatus ofValue(int dbData) { + return Arrays.stream(EnMeetingStatus.values()).filter(v -> v.getValue() == (dbData)).findFirst() + .orElseThrow(() -> new BadRequestException( + String.format("EnMeetingStatus 클래스에 value = [%s] 값을 가진 enum 객체가 없습니다.", dbData))); + } - public int getValue() { - return value; - } + public int getValue() { + return value; + } } diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/PushNotificationEnums.java b/main/src/main/java/org/sopt/makers/crew/main/external/notification/PushNotificationEnums.java similarity index 92% rename from main/src/main/java/org/sopt/makers/crew/main/internal/notification/PushNotificationEnums.java rename to main/src/main/java/org/sopt/makers/crew/main/external/notification/PushNotificationEnums.java index f8e92a3d..b70777fe 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/PushNotificationEnums.java +++ b/main/src/main/java/org/sopt/makers/crew/main/external/notification/PushNotificationEnums.java @@ -1,4 +1,4 @@ -package org.sopt.makers.crew.main.internal.notification; +package org.sopt.makers.crew.main.external.notification; import lombok.AccessLevel; import lombok.Getter; diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/PushNotificationServerClient.java b/main/src/main/java/org/sopt/makers/crew/main/external/notification/PushNotificationServerClient.java similarity index 80% rename from main/src/main/java/org/sopt/makers/crew/main/internal/notification/PushNotificationServerClient.java rename to main/src/main/java/org/sopt/makers/crew/main/external/notification/PushNotificationServerClient.java index 401f0f82..5447500e 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/PushNotificationServerClient.java +++ b/main/src/main/java/org/sopt/makers/crew/main/external/notification/PushNotificationServerClient.java @@ -1,7 +1,7 @@ -package org.sopt.makers.crew.main.internal.notification; +package org.sopt.makers.crew.main.external.notification; -import org.sopt.makers.crew.main.internal.notification.dto.PushNotificationRequestDto; -import org.sopt.makers.crew.main.internal.notification.dto.PushNotificationResponseDto; +import org.sopt.makers.crew.main.external.notification.dto.PushNotificationRequestDto; +import org.sopt.makers.crew.main.external.notification.dto.PushNotificationResponseDto; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/PushNotificationService.java b/main/src/main/java/org/sopt/makers/crew/main/external/notification/PushNotificationService.java similarity index 72% rename from main/src/main/java/org/sopt/makers/crew/main/internal/notification/PushNotificationService.java rename to main/src/main/java/org/sopt/makers/crew/main/external/notification/PushNotificationService.java index acc4b525..5216eecd 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/PushNotificationService.java +++ b/main/src/main/java/org/sopt/makers/crew/main/external/notification/PushNotificationService.java @@ -1,14 +1,13 @@ -package org.sopt.makers.crew.main.internal.notification; +package org.sopt.makers.crew.main.external.notification; import static org.sopt.makers.crew.main.global.exception.ErrorStatus.*; -import static org.sopt.makers.crew.main.internal.notification.PushNotificationEnums.PUSH_NOTIFICATION_ACTION; import java.util.UUID; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.sopt.makers.crew.main.internal.notification.dto.PushNotificationRequestDto; +import org.sopt.makers.crew.main.external.notification.dto.PushNotificationRequestDto; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -28,7 +27,7 @@ public class PushNotificationService { public void sendPushNotification(PushNotificationRequestDto request) { try { pushServerClient.sendPushNotification(pushNotificationApiKey, - PUSH_NOTIFICATION_ACTION.getValue(), UUID.randomUUID().toString(), service, request); + PushNotificationEnums.PUSH_NOTIFICATION_ACTION.getValue(), UUID.randomUUID().toString(), service, request); }catch (Exception e){ log.error(NOTIFICATION_SERVER_ERROR.getErrorCode(), e); } diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/dto/PushNotificationRequestDto.java b/main/src/main/java/org/sopt/makers/crew/main/external/notification/dto/PushNotificationRequestDto.java similarity index 82% rename from main/src/main/java/org/sopt/makers/crew/main/internal/notification/dto/PushNotificationRequestDto.java rename to main/src/main/java/org/sopt/makers/crew/main/external/notification/dto/PushNotificationRequestDto.java index 33c3d947..10bf47e5 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/dto/PushNotificationRequestDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/external/notification/dto/PushNotificationRequestDto.java @@ -1,4 +1,4 @@ -package org.sopt.makers.crew.main.internal.notification.dto; +package org.sopt.makers.crew.main.external.notification.dto; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/dto/PushNotificationResponseDto.java b/main/src/main/java/org/sopt/makers/crew/main/external/notification/dto/PushNotificationResponseDto.java similarity index 85% rename from main/src/main/java/org/sopt/makers/crew/main/internal/notification/dto/PushNotificationResponseDto.java rename to main/src/main/java/org/sopt/makers/crew/main/external/notification/dto/PushNotificationResponseDto.java index 7f5d4f26..3573643d 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/internal/notification/dto/PushNotificationResponseDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/external/notification/dto/PushNotificationResponseDto.java @@ -1,4 +1,4 @@ -package org.sopt.makers.crew.main.internal.notification.dto; +package org.sopt.makers.crew.main.external.notification.dto; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; diff --git a/main/src/main/java/org/sopt/makers/crew/main/external/playground/service/MemberBlockService.java b/main/src/main/java/org/sopt/makers/crew/main/external/playground/service/MemberBlockService.java index 6de4bf18..d125cf78 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/external/playground/service/MemberBlockService.java +++ b/main/src/main/java/org/sopt/makers/crew/main/external/playground/service/MemberBlockService.java @@ -5,6 +5,4 @@ public interface MemberBlockService { Map getBlockedUsers(Long blockerOrgId, List userOrgIds); - - Map getBlockedUsers(Long blockerOrgId); } \ No newline at end of file diff --git a/main/src/main/java/org/sopt/makers/crew/main/external/playground/service/MemberBlockServiceImpl.java b/main/src/main/java/org/sopt/makers/crew/main/external/playground/service/MemberBlockServiceImpl.java index 6b96da29..9d600a0e 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/external/playground/service/MemberBlockServiceImpl.java +++ b/main/src/main/java/org/sopt/makers/crew/main/external/playground/service/MemberBlockServiceImpl.java @@ -24,12 +24,4 @@ public Map getBlockedUsers(Long blockerOrgId, List userOrgI .filter(memberBlock -> userOrgIds.contains(memberBlock.getBlockedMember())) .collect(Collectors.toMap(MemberBlock::getBlockedMember, memberBlock -> true)); } - - @Override - public Map getBlockedUsers(Long blockerOrgId) { - List memberBlocks = memberBlockRepository.findAllByBlockerAndIsBlockedTrue(blockerOrgId); - - return memberBlocks.stream() - .collect(Collectors.toMap(MemberBlock::getBlockedMember, memberBlock -> true)); - } } \ No newline at end of file diff --git a/main/src/main/java/org/sopt/makers/crew/main/global/config/SecurityConfig.java b/main/src/main/java/org/sopt/makers/crew/main/global/config/SecurityConfig.java index 5cff0a6e..637ac9ab 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/global/config/SecurityConfig.java +++ b/main/src/main/java/org/sopt/makers/crew/main/global/config/SecurityConfig.java @@ -53,7 +53,7 @@ private String[] getAuthWhitelist() { "/auth/v2", "/auth/v2/**", actuatorEndPoint + "/health", - "/sentry" // prod에서 테스트 후 삭제 + "/internal/**" }; } diff --git a/main/src/main/java/org/sopt/makers/crew/main/global/dto/MeetingResponseDto.java b/main/src/main/java/org/sopt/makers/crew/main/global/dto/MeetingResponseDto.java index d8a676a7..05125b0d 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/global/dto/MeetingResponseDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/global/dto/MeetingResponseDto.java @@ -91,7 +91,7 @@ public static MeetingResponseDto of(Meeting meeting, User meetingCreator, int ap return new MeetingResponseDto(meeting.getId(), meeting.getTitle(), meeting.getTargetActiveGeneration(), meeting.getJoinableParts(), meeting.getCategory().getValue(), - canJoinOnlyActiveGeneration, meeting.getMeetingStatus(now), meeting.getImageURL(), + canJoinOnlyActiveGeneration, meeting.getMeetingStatusValue(now), meeting.getImageURL(), meeting.getIsMentorNeeded(), meeting.getMStartDate(), meeting.getMEndDate(), meeting.getCapacity(), creatorDto, approvedCount, approvedCount); } diff --git a/main/src/main/java/org/sopt/makers/crew/main/global/pagination/dto/PageOptionsDto.java b/main/src/main/java/org/sopt/makers/crew/main/global/pagination/dto/PageOptionsDto.java index d88b95be..98776885 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/global/pagination/dto/PageOptionsDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/global/pagination/dto/PageOptionsDto.java @@ -8,17 +8,17 @@ @Getter public class PageOptionsDto { - @Schema(description = "각 페이지", defaultValue = "1", example = "1") - @Min(1) - private Integer page; + @Schema(description = "각 페이지", defaultValue = "1", example = "1") + @Min(1) + private Integer page; - @Schema(description = "가져올 데이터 개수", defaultValue = "12", example = "12") - @Min(1) - @Max(50) - private Integer take; + @Schema(description = "가져올 데이터 개수", defaultValue = "12", example = "12") + @Min(1) + @Max(50) + private Integer take; - public PageOptionsDto(Integer page, Integer take) { - this.page = page == null ? 1 : page; - this.take = take == null ? 12 : take; - } + public PageOptionsDto(Integer page, Integer take) { + this.page = page == null ? 1 : page; + this.take = take == null ? 12 : take; + } } diff --git a/main/src/main/java/org/sopt/makers/crew/main/global/util/AdvertisementCustomPageable.java b/main/src/main/java/org/sopt/makers/crew/main/global/util/AdvertisementCustomPageable.java new file mode 100644 index 00000000..60e14787 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/global/util/AdvertisementCustomPageable.java @@ -0,0 +1,85 @@ +package org.sopt.makers.crew.main.global.util; + +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; + +/** + * AdvertisementCustomPageable : 광고 관련된 컨텐츠에 대해 페이지네이션이 필요할 때 사용하는 클래스 + * + * @implSpec : 광고 때문에 첫페이지는 11개를, 나머지는 12개를 반환해야 한다. + * @implNote : 일반적인 페이지네이션 방식과 다르기에 해당 클래스를 따로 만들어 커스텀화하였다. + * */ +public class AdvertisementCustomPageable implements Pageable { + + private final int page; + private final int size; + private final Sort sort; + + public AdvertisementCustomPageable(int page, Sort sort) { + this.page = page; + this.sort = sort; + this.size = calculateSize(page); + } + + private int calculateSize(int page) { + // 첫 번째 페이지는 11개, 그 이후부터는 12개 + if (page == 0) { + return 11; + } + return 12; + } + + @Override + public int getPageNumber() { + return this.page; + } + + @Override + public int getPageSize() { + return this.size; + } + + @Override + public long getOffset() { + // 오프셋 계산 + // 첫 번째 페이지는 11개, 그 이후부터는 12개 고려 + if (page == 0) { + return 0; + } + return 11 + (page - 1) * 12L; + } + + @Override + public Sort getSort() { + return this.sort; + } + + @Override + public Pageable next() { + return new AdvertisementCustomPageable(this.page + 1, this.sort); + } + + @Override + public Pageable previousOrFirst() { + if (page == 0) { + return this; + } + return new AdvertisementCustomPageable(this.page - 1, this.sort); + } + + @Override + public Pageable first() { + return new AdvertisementCustomPageable(0, this.sort); + } + + @Override + public boolean hasPrevious() { + return this.page > 0; + } + + @Override + public Pageable withPage(int pageNumber) { + // 새로운 페이지 번호로 CustomPageable 생성 + return new AdvertisementCustomPageable(pageNumber, this.sort); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/global/util/CustomPageable.java b/main/src/main/java/org/sopt/makers/crew/main/global/util/CustomPageable.java index 721eaad4..0dac06ba 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/global/util/CustomPageable.java +++ b/main/src/main/java/org/sopt/makers/crew/main/global/util/CustomPageable.java @@ -9,15 +9,10 @@ public class CustomPageable implements Pageable { private final int size; private final Sort sort; - public CustomPageable(int page, Sort sort) { + public CustomPageable(int page, int size, Sort sort) { this.page = page; + this.size = size; this.sort = sort; - this.size = calculateSize(page); - } - - private int calculateSize(int page) { - // 첫 번째 페이지는 11개, 그 이후부터는 12개 - return page == 0 ? 11 : 12; } @Override @@ -32,8 +27,7 @@ public int getPageSize() { @Override public long getOffset() { - // 오프셋 계산 - return page == 0 ? 0 : 11 + (page - 1) * 12; + return (long)(page - 1) * size + size; } @Override @@ -43,27 +37,29 @@ public Sort getSort() { @Override public Pageable next() { - return new CustomPageable(this.page + 1, this.sort); + return new CustomPageable(this.page + 1, this.size, this.sort); } @Override public Pageable previousOrFirst() { - return this.page == 0 ? this : new CustomPageable(this.page - 1, this.sort); + if (this.page == 0) { + return this; + } + return new CustomPageable(this.page - 1, this.size, this.sort); } @Override public Pageable first() { - return new CustomPageable(0, this.sort); + return new CustomPageable(0, this.size, this.sort); } @Override - public boolean hasPrevious() { - return this.page > 0; + public Pageable withPage(int pageNumber) { + return new CustomPageable(pageNumber, this.size, this.sort); } @Override - public Pageable withPage(int pageNumber) { - // 새로운 페이지 번호로 CustomPageable 생성 - return new CustomPageable(pageNumber, this.sort); + public boolean hasPrevious() { + return this.page > 0; } } diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/InternalMeetingApi.java b/main/src/main/java/org/sopt/makers/crew/main/internal/InternalMeetingApi.java new file mode 100644 index 00000000..25b4233e --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/internal/InternalMeetingApi.java @@ -0,0 +1,34 @@ +package org.sopt.makers.crew.main.internal; + +import org.sopt.makers.crew.main.internal.dto.InternalMeetingGetAllMeetingDto; +import org.sopt.makers.crew.main.meeting.v2.dto.query.MeetingV2GetAllMeetingQueryDto; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestParam; + +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; + +@Tag(name = "[Internal] 모임") +public interface InternalMeetingApi { + + @Operation(summary = "[Internal] 모임 전체 조회/검색/필터링", description = "모임 전체 조회/검색/필터링") + @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "모임 목록 조회 성공")}) + @Parameters(value = { + @Parameter(name = "page", description = "페이지", example = "1", required = true, schema = @Schema(type = "integer", format = "int32")), + @Parameter(name = "take", description = "가져올 데이터 개수", example = "10", required = true, schema = @Schema(type = "integer", format = "int32")), + @Parameter(name = "category", description = "카테고리", example = "[스터디, 행사, 세미나]", required = true, array = @ArraySchema(schema = @Schema(type = "string"))), + @Parameter(name = "isOnlyActiveGeneration", description = "활동기수만 참여여부", example = "true", required = true, schema = @Schema(type = "boolean", format = "boolean")), + }) + ResponseEntity getMeetings( + @ModelAttribute @Valid @Parameter(hidden = true) MeetingV2GetAllMeetingQueryDto queryCommand, + @RequestParam @Valid Integer orgId); +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/InternalMeetingController.java b/main/src/main/java/org/sopt/makers/crew/main/internal/InternalMeetingController.java new file mode 100644 index 00000000..3a9fc4a5 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/internal/InternalMeetingController.java @@ -0,0 +1,31 @@ +package org.sopt.makers.crew.main.internal; + +import org.sopt.makers.crew.main.internal.dto.InternalMeetingGetAllMeetingDto; +import org.sopt.makers.crew.main.internal.dto.UserOrgIdRequestDto; +import org.sopt.makers.crew.main.internal.service.InternalMeetingService; +import org.sopt.makers.crew.main.meeting.v2.dto.query.MeetingV2GetAllMeetingQueryDto; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; + +@RestController +@RequestMapping("/internal/meetings") +@RequiredArgsConstructor +public class InternalMeetingController implements InternalMeetingApi { + private final InternalMeetingService internalMeetingService; + + @Override + @GetMapping + public ResponseEntity getMeetings( + @ModelAttribute @Valid MeetingV2GetAllMeetingQueryDto queryCommand, + @RequestParam @Valid Integer orgId) { + + return ResponseEntity.ok().body(internalMeetingService.getMeetings(queryCommand, orgId)); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingGetAllMeetingDto.java b/main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingGetAllMeetingDto.java new file mode 100644 index 00000000..b9bcdbb7 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingGetAllMeetingDto.java @@ -0,0 +1,22 @@ +package org.sopt.makers.crew.main.internal.dto; + +import java.util.List; + +import org.sopt.makers.crew.main.global.pagination.dto.PageMetaDto; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +@Schema(name = "InternalMeetingGetAllMeetingDto", description = "[Internal] 모임 목록 조회 응답 Dto") +public record InternalMeetingGetAllMeetingDto( + @Schema(description = "모임 객체 목록", example = "") + @NotNull + List meetings, + @Schema(description = "페이지네이션 객체", example = "") + @NotNull + PageMetaDto meta +) { + public static InternalMeetingGetAllMeetingDto of(List meetings, PageMetaDto meta) { + return new InternalMeetingGetAllMeetingDto(meetings, meta); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingGetAllMeetingQueryDto.java b/main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingGetAllMeetingQueryDto.java new file mode 100644 index 00000000..e239afd1 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingGetAllMeetingQueryDto.java @@ -0,0 +1,23 @@ +package org.sopt.makers.crew.main.internal.dto; + +import java.util.List; + +import org.sopt.makers.crew.main.global.pagination.dto.PageOptionsDto; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Getter; + +@Getter +@Schema(name = "InternalMeetingGetAllMeetingQueryDto", description = "[Internal] 모임 조회 요청 Dto") +public class InternalMeetingGetAllMeetingQueryDto extends PageOptionsDto { + @Schema( + description = "모임 종류", + example = "스터디", + allowableValues = {"스터디", "행사", "세미나"}) + private final List category; + + public InternalMeetingGetAllMeetingQueryDto(Integer page, Integer take, List category) { + super(page, take); + this.category = category; + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingResponseDto.java b/main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingResponseDto.java new file mode 100644 index 00000000..02d568e2 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/internal/dto/InternalMeetingResponseDto.java @@ -0,0 +1,34 @@ +package org.sopt.makers.crew.main.internal.dto; + +import java.time.LocalDateTime; + +import org.sopt.makers.crew.main.entity.meeting.Meeting; +import org.sopt.makers.crew.main.entity.meeting.enums.EnMeetingStatus; + +import io.swagger.v3.oas.annotations.media.Schema; + +@Schema(name = "InternalMeetingResponseDto", description = "[Internal] 모임 조회 응답 Dto") +public record InternalMeetingResponseDto( + @Schema(description = "모임 객체 목록", example = "") + Integer id, + @Schema(description = "모임 제목", example = "") + String title, + @Schema(description = "활동 기수만 신청가능한 여부", example = "false") + boolean canJoinOnlyActiveGeneration, + @Schema( + description = "모임 상태, BEFORE_START: 모집전, APPLY_ABLE: 모집중, RECRUITMENT_COMPLETE: 모집종료", + example = "APPLY_ABLE", + allowableValues = {"BEFORE_START", "APPLY_ABLE", "RECRUITMENT_COMPLETE"}) + EnMeetingStatus status, + @Schema(description = "모임 이미지", example = "[url 형식]") + String imageUrl, + @Schema(description = "모임 차단 여부", example = "false") + boolean isBlockedMeeting +) { + public static InternalMeetingResponseDto of(Meeting meeting, LocalDateTime now, boolean isBlockedMeeting) { + return new InternalMeetingResponseDto(meeting.getId(), meeting.getTitle(), + meeting.getCanJoinOnlyActiveGeneration(), meeting.getMeetingStatus(now), + meeting.getImageURL().get(0).getUrl(), + isBlockedMeeting); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/dto/UserOrgIdRequestDto.java b/main/src/main/java/org/sopt/makers/crew/main/internal/dto/UserOrgIdRequestDto.java new file mode 100644 index 00000000..2a048447 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/internal/dto/UserOrgIdRequestDto.java @@ -0,0 +1,11 @@ +package org.sopt.makers.crew.main.internal.dto; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; + +public record UserOrgIdRequestDto( + @Schema(example = "301", description = "플레이그라운드 유저 id") + @NotNull + Integer orgId +) { +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/internal/service/InternalMeetingService.java b/main/src/main/java/org/sopt/makers/crew/main/internal/service/InternalMeetingService.java new file mode 100644 index 00000000..b73b52e6 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/internal/service/InternalMeetingService.java @@ -0,0 +1,67 @@ +package org.sopt.makers.crew.main.internal.service; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.sopt.makers.crew.main.entity.meeting.Meeting; +import org.sopt.makers.crew.main.entity.meeting.MeetingRepository; +import org.sopt.makers.crew.main.external.playground.service.MemberBlockService; +import org.sopt.makers.crew.main.global.pagination.dto.PageMetaDto; +import org.sopt.makers.crew.main.global.pagination.dto.PageOptionsDto; +import org.sopt.makers.crew.main.global.util.CustomPageable; +import org.sopt.makers.crew.main.global.util.Time; +import org.sopt.makers.crew.main.internal.dto.InternalMeetingGetAllMeetingDto; +import org.sopt.makers.crew.main.internal.dto.InternalMeetingResponseDto; +import org.sopt.makers.crew.main.internal.dto.UserOrgIdRequestDto; +import org.sopt.makers.crew.main.meeting.v2.dto.query.MeetingV2GetAllMeetingQueryDto; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import lombok.RequiredArgsConstructor; + +@Service +@RequiredArgsConstructor +@Transactional(readOnly = true) +public class InternalMeetingService { + private final MeetingRepository meetingRepository; + private final MemberBlockService memberBlockService; + + private final Time time; + + /** + * [for. APP BE] 모일 리스트 페이지네이션 조회 (10개) + * + * @param queryCommand 게시글 조회를 위한 쿼리 명령 객체 + * @param orgId 플레이그라운드 orgId + * @return 게시글 정보(게시글 객체 + 댓글 단 사람의 썸네일 + 차단된 유저의 게시물 여부)와 페이지 메타 정보를 포함한 응답 DTO + * @apiNote 사용자가 차단한 유저의 모임은 해당 모임에 대한 차단 여부를 함께 반환 + */ + public InternalMeetingGetAllMeetingDto getMeetings( + MeetingV2GetAllMeetingQueryDto queryCommand, Integer orgId) { + Sort sort = Sort.by(Sort.Direction.ASC, "id"); + + Page meetings = meetingRepository.findAllByQuery(queryCommand, + new CustomPageable(queryCommand.getPage() - 1, queryCommand.getTake(), sort), time); + + List userOrgIds = meetings.getContent() + .stream() + .map(meeting -> meeting.getUser().getOrgId().longValue()) + .toList(); + + Map blockedUsers = memberBlockService.getBlockedUsers(orgId.longValue(), userOrgIds); + + List meetingResponseDtos = meetings.getContent().stream() + .map(meeting -> InternalMeetingResponseDto.of(meeting, time.now(), + blockedUsers.getOrDefault(meeting.getUserId().longValue(), false))) + .toList(); + + PageOptionsDto pageOptionsDto = new PageOptionsDto(meetings.getPageable().getPageNumber() + 1, + meetings.getPageable().getPageSize()); + PageMetaDto pageMetaDto = new PageMetaDto(pageOptionsDto, (int)meetings.getTotalElements()); + + return new InternalMeetingGetAllMeetingDto(meetingResponseDtos, pageMetaDto); + } +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/dto/response/MeetingV2GetMeetingBannerResponseDto.java b/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/dto/response/MeetingV2GetMeetingBannerResponseDto.java index 51356df3..76832234 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/dto/response/MeetingV2GetMeetingBannerResponseDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/dto/response/MeetingV2GetMeetingBannerResponseDto.java @@ -118,7 +118,7 @@ public static MeetingV2GetMeetingBannerResponseDto of(Meeting meeting, LocalDate meeting.getImageURL(), meeting.getMStartDate(), meeting.getMEndDate(), meeting.getStartDate(), meeting.getEndDate(), meeting.getCapacity(), recentActivityDate, meeting.getTargetActiveGeneration(), meeting.getJoinableParts(), applicantCount, approvedUserCount, - meetingCreator, meeting.getMeetingStatus(now)); + meetingCreator, meeting.getMeetingStatusValue(now)); } } diff --git a/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/dto/response/MeetingV2GetMeetingByIdResponseDto.java b/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/dto/response/MeetingV2GetMeetingByIdResponseDto.java index f58cd236..e3d274cc 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/dto/response/MeetingV2GetMeetingByIdResponseDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/dto/response/MeetingV2GetMeetingByIdResponseDto.java @@ -147,7 +147,7 @@ public static MeetingV2GetMeetingByIdResponseDto of(Meeting meeting, List coLeaderResponseDtos = coLeaders.stream() .map(coLeader -> MeetingV2CoLeaderResponseDto.of(coLeader.getUser())) diff --git a/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/service/MeetingV2ServiceImpl.java b/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/service/MeetingV2ServiceImpl.java index 9bf1ccb5..244790cc 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/service/MeetingV2ServiceImpl.java +++ b/main/src/main/java/org/sopt/makers/crew/main/meeting/v2/service/MeetingV2ServiceImpl.java @@ -49,7 +49,7 @@ import org.sopt.makers.crew.main.global.exception.ServerException; import org.sopt.makers.crew.main.global.pagination.dto.PageMetaDto; import org.sopt.makers.crew.main.global.pagination.dto.PageOptionsDto; -import org.sopt.makers.crew.main.global.util.CustomPageable; +import org.sopt.makers.crew.main.global.util.AdvertisementCustomPageable; import org.sopt.makers.crew.main.global.util.Time; import org.sopt.makers.crew.main.global.util.UserPartUtil; import org.sopt.makers.crew.main.meeting.v2.dto.ApplyMapper; @@ -294,7 +294,7 @@ public MeetingGetApplyListResponseDto findApplyList(MeetingGetAppliesQueryDto qu public MeetingV2GetAllMeetingDto getMeetings(MeetingV2GetAllMeetingQueryDto queryCommand) { Sort sort = Sort.by(Sort.Direction.ASC, "id"); Page meetings = meetingRepository.findAllByQuery(queryCommand, - new CustomPageable(queryCommand.getPage() - 1, sort), time); + new AdvertisementCustomPageable(queryCommand.getPage() - 1, sort), time); List meetingIds = meetings.stream().map(Meeting::getId).toList(); Applies allApplies = new Applies(applyRepository.findAllByMeetingIdIn(meetingIds)); diff --git a/main/src/main/java/org/sopt/makers/crew/main/post/v2/service/PostV2ServiceImpl.java b/main/src/main/java/org/sopt/makers/crew/main/post/v2/service/PostV2ServiceImpl.java index ebdde882..1cfe1c27 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/post/v2/service/PostV2ServiceImpl.java +++ b/main/src/main/java/org/sopt/makers/crew/main/post/v2/service/PostV2ServiceImpl.java @@ -2,7 +2,7 @@ import static java.util.stream.Collectors.*; import static org.sopt.makers.crew.main.global.exception.ErrorStatus.*; -import static org.sopt.makers.crew.main.internal.notification.PushNotificationEnums.*; +import static org.sopt.makers.crew.main.external.notification.PushNotificationEnums.*; import java.util.List; import java.util.Map; @@ -12,7 +12,7 @@ import org.sopt.makers.crew.main.global.exception.ForbiddenException; import org.sopt.makers.crew.main.global.pagination.dto.PageMetaDto; import org.sopt.makers.crew.main.global.pagination.dto.PageOptionsDto; -import org.sopt.makers.crew.main.global.util.CustomPageable; +import org.sopt.makers.crew.main.global.util.AdvertisementCustomPageable; import org.sopt.makers.crew.main.global.util.Time; import org.sopt.makers.crew.main.entity.apply.Apply; import org.sopt.makers.crew.main.entity.apply.ApplyRepository; @@ -30,8 +30,8 @@ import org.sopt.makers.crew.main.entity.user.User; import org.sopt.makers.crew.main.entity.user.UserRepository; import org.sopt.makers.crew.main.external.playground.service.MemberBlockService; -import org.sopt.makers.crew.main.internal.notification.PushNotificationService; -import org.sopt.makers.crew.main.internal.notification.dto.PushNotificationRequestDto; +import org.sopt.makers.crew.main.external.notification.PushNotificationService; +import org.sopt.makers.crew.main.external.notification.dto.PushNotificationRequestDto; import org.sopt.makers.crew.main.post.v2.dto.query.PostGetPostsCommand; import org.sopt.makers.crew.main.post.v2.dto.request.PostV2CreatePostBodyDto; import org.sopt.makers.crew.main.post.v2.dto.request.PostV2MentionUserInPostRequestDto; @@ -139,7 +139,7 @@ public PostV2CreatePostResponseDto createPost(PostV2CreatePostBodyDto requestBod public PostV2GetPostsResponseDto getPosts(PostGetPostsCommand queryCommand, Integer userId) { Sort sort = Sort.by(Sort.Direction.ASC, "id"); Page meetingPostListDtos = postRepository.findPostList(queryCommand, - new CustomPageable(queryCommand.getPage() - 1, sort), userId); + new AdvertisementCustomPageable(queryCommand.getPage() - 1, sort), userId); PageOptionsDto pageOptionsDto = new PageOptionsDto(meetingPostListDtos.getPageable().getPageNumber() + 1, meetingPostListDtos.getPageable().getPageSize()); diff --git a/main/src/main/java/org/sopt/makers/crew/main/user/v2/dto/response/MeetingV2GetCreatedMeetingByUserResponseDto.java b/main/src/main/java/org/sopt/makers/crew/main/user/v2/dto/response/MeetingV2GetCreatedMeetingByUserResponseDto.java index 83b4ce47..8a3c2485 100644 --- a/main/src/main/java/org/sopt/makers/crew/main/user/v2/dto/response/MeetingV2GetCreatedMeetingByUserResponseDto.java +++ b/main/src/main/java/org/sopt/makers/crew/main/user/v2/dto/response/MeetingV2GetCreatedMeetingByUserResponseDto.java @@ -8,7 +8,6 @@ import org.sopt.makers.crew.main.entity.meeting.Meeting; import org.sopt.makers.crew.main.entity.meeting.enums.MeetingJoinablePart; import org.sopt.makers.crew.main.entity.meeting.vo.ImageUrlVO; -import org.sopt.makers.crew.main.entity.user.User; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotNull; @@ -83,7 +82,7 @@ public static MeetingV2GetCreatedMeetingByUserResponseDto of(Meeting meeting, bo return new MeetingV2GetCreatedMeetingByUserResponseDto(meeting.getId(), meeting.getTitle(), meeting.getTargetActiveGeneration(), meeting.getJoinableParts(), meeting.getCategory().getValue(), - canJoinOnlyActiveGeneration, meeting.getMeetingStatus(now), isCoLeader, meeting.getImageURL(), + canJoinOnlyActiveGeneration, meeting.getMeetingStatusValue(now), isCoLeader, meeting.getImageURL(), meeting.getIsMentorNeeded(), meeting.getMStartDate(), meeting.getMEndDate(), meeting.getCapacity(), creatorDto, approvedCount, approvedCount); } diff --git a/main/src/test/java/org/sopt/makers/crew/main/entity/meeting/MeetingTest.java b/main/src/test/java/org/sopt/makers/crew/main/entity/meeting/MeetingTest.java index eb0bff31..c30eb179 100644 --- a/main/src/test/java/org/sopt/makers/crew/main/entity/meeting/MeetingTest.java +++ b/main/src/test/java/org/sopt/makers/crew/main/entity/meeting/MeetingTest.java @@ -80,11 +80,11 @@ public class MeetingTest { .build(); // when - Integer beforeRecruitment = meeting.getMeetingStatus(LocalDateTime.of(2024, 4, 23, 23, 59, 59)); - Integer recruiting = meeting.getMeetingStatus(LocalDateTime.of(2024, 4, 24, 0, 0, 0)); - Integer closeRecruitment = meeting.getMeetingStatus(LocalDateTime.of(2024, 4, 30, 0, 0, 0)); - Integer active = meeting.getMeetingStatus(LocalDateTime.of(2024, 5, 24, 0, 0, 0)); - Integer activityEnd = meeting.getMeetingStatus(LocalDateTime.of(2024, 6, 24, 0, 0, 1)); + Integer beforeRecruitment = meeting.getMeetingStatusValue(LocalDateTime.of(2024, 4, 23, 23, 59, 59)); + Integer recruiting = meeting.getMeetingStatusValue(LocalDateTime.of(2024, 4, 24, 0, 0, 0)); + Integer closeRecruitment = meeting.getMeetingStatusValue(LocalDateTime.of(2024, 4, 30, 0, 0, 0)); + Integer active = meeting.getMeetingStatusValue(LocalDateTime.of(2024, 5, 24, 0, 0, 0)); + Integer activityEnd = meeting.getMeetingStatusValue(LocalDateTime.of(2024, 6, 24, 0, 0, 1)); // then