From 33f304ae4c0eb7f3b7c0e0f91d49dfa2e08198d2 Mon Sep 17 00:00:00 2001 From: Khyojun Date: Wed, 22 Jan 2025 23:49:39 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[fix]=20#166=20weekDay=20=EB=A1=9C=20respon?= =?UTF-8?q?se=20=EC=88=98=EC=A0=95=20=EC=A7=84=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ggang/be/domain/timslot/vo/ReadCommonInvalidTimeVo.java | 2 +- src/main/java/com/ggang/be/global/util/TimeValidator.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ggang/be/domain/timslot/vo/ReadCommonInvalidTimeVo.java b/src/main/java/com/ggang/be/domain/timslot/vo/ReadCommonInvalidTimeVo.java index f679890..4a7428e 100644 --- a/src/main/java/com/ggang/be/domain/timslot/vo/ReadCommonInvalidTimeVo.java +++ b/src/main/java/com/ggang/be/domain/timslot/vo/ReadCommonInvalidTimeVo.java @@ -5,7 +5,7 @@ public record ReadCommonInvalidTimeVo( int idx, - WeekDate weekDate, + WeekDate weekDay, double startTime, double endTime ) { diff --git a/src/main/java/com/ggang/be/global/util/TimeValidator.java b/src/main/java/com/ggang/be/global/util/TimeValidator.java index 21b3d9c..74d6719 100644 --- a/src/main/java/com/ggang/be/global/util/TimeValidator.java +++ b/src/main/java/com/ggang/be/global/util/TimeValidator.java @@ -9,9 +9,9 @@ @Slf4j public class TimeValidator { - public static void isWeekDateRight(WeekDate writeWeekDate, LocalDate writeDate) { + public static void isWeekDateRight(WeekDate writeWeekDay, LocalDate writeDate) { WeekDate realWeekDate = WeekDate.fromDayOfWeek(writeDate.getDayOfWeek()); - if(!realWeekDate.equals(writeWeekDate)) { + if(!realWeekDate.equals(writeWeekDay)) { log.error("weekDate and weekDay is not same"); throw new GongBaekException(ResponseError.BAD_REQUEST); } From 4587a49726d6414c15788c5e0f0e770e62bb131a Mon Sep 17 00:00:00 2001 From: Khyojun Date: Wed, 22 Jan 2025 23:51:17 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[refactor]=20#166=20bean=20=EB=93=B1?= =?UTF-8?q?=EB=A1=9D=20=ED=95=98=EC=A7=80=20=EC=95=8A=EC=95=84=EB=8F=84=20?= =?UTF-8?q?=EB=90=A0=20=EA=B1=B0=20=EA=B0=99=EC=9D=80=20=EA=B0=9D=EC=B2=B4?= =?UTF-8?q?=20static=20=EC=9C=BC=EB=A1=9C=20=ED=98=B8=EC=B6=9C=20=ED=95=A0?= =?UTF-8?q?=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../be/domain/timslot/ReadCommonInvalidTimeVoMaker.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ggang/be/domain/timslot/ReadCommonInvalidTimeVoMaker.java b/src/main/java/com/ggang/be/domain/timslot/ReadCommonInvalidTimeVoMaker.java index b8bda53..963dce7 100644 --- a/src/main/java/com/ggang/be/domain/timslot/ReadCommonInvalidTimeVoMaker.java +++ b/src/main/java/com/ggang/be/domain/timslot/ReadCommonInvalidTimeVoMaker.java @@ -2,15 +2,13 @@ import com.ggang.be.domain.timslot.lectureTimeSlot.LectureTimeSlotEntity; import com.ggang.be.domain.timslot.vo.ReadCommonInvalidTimeVo; -import org.springframework.stereotype.Component; import java.util.Comparator; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; -@Component public class ReadCommonInvalidTimeVoMaker { - public List convertToCommonResponse( + public static List convertToCommonResponse( List lectureTimeSlotEntities) { AtomicInteger atomicInteger = new AtomicInteger(0); return lectureTimeSlotEntities.stream() @@ -19,7 +17,7 @@ public List convertToCommonResponse( .sorted(Comparator.comparing(ReadCommonInvalidTimeVo::idx)).toList(); } - private ReadCommonInvalidTimeVo makeReadCommonInvalidTimeVo(LectureTimeSlotEntity entity, + public static ReadCommonInvalidTimeVo makeReadCommonInvalidTimeVo(LectureTimeSlotEntity entity, AtomicInteger atomicInteger) { return ReadCommonInvalidTimeVo.fromLectureEntity(atomicInteger.getAndIncrement(), entity); From fbbc2a7cb7cfc6e2532c0b46ec658053f7b8278a Mon Sep 17 00:00:00 2001 From: Khyojun Date: Thu, 23 Jan 2025 00:27:24 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[refactor]=20#166=20component=20->=20static?= =?UTF-8?q?=20=EA=B0=9D=EC=B2=B4=EB=A1=9C=20=EC=88=98=EC=A0=95=20=EC=A7=84?= =?UTF-8?q?=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ggang/be/api/facade/TimeTableFacade.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/ggang/be/api/facade/TimeTableFacade.java b/src/main/java/com/ggang/be/api/facade/TimeTableFacade.java index 61b443c..2fadf8a 100644 --- a/src/main/java/com/ggang/be/api/facade/TimeTableFacade.java +++ b/src/main/java/com/ggang/be/api/facade/TimeTableFacade.java @@ -16,12 +16,11 @@ public class TimeTableFacade { private final LectureTimeSlotService lectureTimeSlotService; private final UserService userService; - private final ReadCommonInvalidTimeVoMaker voMaker; public ReadInvalidTimeResponse readMyInvalidTime(final long userId) { UserEntity findUserEntity = userService.getUserById(userId); List lectureTimeSlotEntities = lectureTimeSlotService.readUserTime(findUserEntity); - return ReadInvalidTimeResponse.fromVo(voMaker.convertToCommonResponse(lectureTimeSlotEntities)); + return ReadInvalidTimeResponse.fromVo(ReadCommonInvalidTimeVoMaker.convertToCommonResponse(lectureTimeSlotEntities)); } } From c59a0c9d1440fe659480380e74a42f07958731fc Mon Sep 17 00:00:00 2001 From: Khyojun Date: Thu, 23 Jan 2025 00:31:53 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[fix]=20#166=20WeekDay=20=EA=B4=80=EB=A0=A8?= =?UTF-8?q?=ED=95=98=EC=97=AC=20=ED=81=B4=EB=9E=98=EC=8A=A4=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EC=9E=91=EC=97=85=20=EC=A7=84=ED=96=89,?= =?UTF-8?q?=20api=20=ED=95=84=EB=93=9C=20=EB=B3=80=EA=B2=BD=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=20=EC=A7=84=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ggang/be/api/group/dto/ActiveGroupsResponse.java | 6 +++--- .../com/ggang/be/api/group/dto/GroupResponse.java | 4 ++-- .../com/ggang/be/api/group/dto/LatestResponse.java | 8 ++++---- .../com/ggang/be/api/group/dto/MyGroupResponse.java | 8 ++++---- .../ggang/be/api/group/dto/NearestGroupResponse.java | 4 ++-- .../be/api/group/dto/RegisterGongbaekRequest.java | 8 ++++---- .../com/ggang/be/api/mapper/GroupResponseMapper.java | 2 +- .../java/com/ggang/be/api/user/vo/TimeTableVo.java | 4 ++-- .../domain/constant/{WeekDate.java => WeekDay.java} | 12 ++++++------ .../java/com/ggang/be/domain/group/dto/GroupVo.java | 8 ++++---- .../group/dto/RegisterGroupServiceRequest.java | 4 ++-- .../be/domain/group/everyGroup/dto/EveryGroupVo.java | 6 +++--- .../group/everyGroup/infra/EveryGroupRepository.java | 6 +++--- .../be/domain/group/onceGroup/dto/OnceGroupDto.java | 8 ++++---- .../com/ggang/be/domain/group/vo/NearestGroup.java | 10 +++++----- .../domain/timslot/ReadCommonInvalidTimeVoMaker.java | 2 +- .../gongbaekTimeSlot/GongbaekTimeSlotEntity.java | 8 ++++---- .../application/GongbaekTimeSlotServiceImpl.java | 2 +- .../dto/GongbaekTimeSlotRequest.java | 4 ++-- .../lectureTimeSlot/LectureTimeSlotEntity.java | 8 ++++---- .../application/LectureTimeSlotServiceImpl.java | 4 ++-- .../lectureTimeSlot/dto/LectureTimeSlotRequest.java | 8 ++++---- .../infra/LectureTimeSlotRepository.java | 6 +++--- .../lectureTimeSlot/vo/LectureTimeSlotVo.java | 6 +++--- .../domain/timslot/vo/ReadCommonInvalidTimeVo.java | 6 +++--- .../application/UserEveryGroupServiceImpl.java | 4 ++-- .../java/com/ggang/be/global/util/TimeValidator.java | 8 ++++---- .../gongbaekTImeSlot/GongbaekTimeSlotFixture.java | 4 ++-- .../application/LectureTimeSlotServiceImplTest.java | 8 ++++---- .../fixture/LectureTimeSlotFixture.java | 4 ++-- 30 files changed, 90 insertions(+), 90 deletions(-) rename src/main/java/com/ggang/be/domain/constant/{WeekDate.java => WeekDay.java} (77%) diff --git a/src/main/java/com/ggang/be/api/group/dto/ActiveGroupsResponse.java b/src/main/java/com/ggang/be/api/group/dto/ActiveGroupsResponse.java index dbedfac..c4a579c 100644 --- a/src/main/java/com/ggang/be/api/group/dto/ActiveGroupsResponse.java +++ b/src/main/java/com/ggang/be/api/group/dto/ActiveGroupsResponse.java @@ -2,7 +2,7 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.GroupType; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.dto.GroupVo; import java.time.LocalDate; @@ -14,7 +14,7 @@ public record ActiveGroupsResponse( int profileImg, GroupType groupType, String groupTitle, - WeekDate weekDay, + WeekDay weekDay, LocalDate weekDate, double startTime, double endTime, @@ -28,8 +28,8 @@ public static ActiveGroupsResponse fromGroupVo(GroupVo groupVo) { groupVo.profileImg(), groupVo.groupType(), groupVo.groupTitle(), + groupVo.weekDay(), groupVo.weekDate(), - groupVo.groupDate(), groupVo.startTime(), groupVo.endTime(), groupVo.location() diff --git a/src/main/java/com/ggang/be/api/group/dto/GroupResponse.java b/src/main/java/com/ggang/be/api/group/dto/GroupResponse.java index ff06cda..4871d31 100644 --- a/src/main/java/com/ggang/be/api/group/dto/GroupResponse.java +++ b/src/main/java/com/ggang/be/api/group/dto/GroupResponse.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.Status; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; public record GroupResponse( long groupId, @@ -18,7 +18,7 @@ public record GroupResponse( String introduction, Category category, int coverImg, - WeekDate weekDay, + WeekDay weekDay, String weekDate, double startTime, double endTime diff --git a/src/main/java/com/ggang/be/api/group/dto/LatestResponse.java b/src/main/java/com/ggang/be/api/group/dto/LatestResponse.java index 31906cd..031fa3f 100644 --- a/src/main/java/com/ggang/be/api/group/dto/LatestResponse.java +++ b/src/main/java/com/ggang/be/api/group/dto/LatestResponse.java @@ -2,7 +2,7 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.GroupType; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.dto.GroupVo; import java.time.LocalDate; @@ -15,8 +15,8 @@ public record LatestResponse( String nickname, GroupType groupType, String groupTitle, - WeekDate weekDate, - LocalDate groupDate, + WeekDay weekDay, + LocalDate weekDate, double startTime, double endTime, String location @@ -30,8 +30,8 @@ public static LatestResponse fromGroupVo(GroupVo groupVo) { groupVo.nickname(), groupVo.groupType(), groupVo.groupTitle(), + groupVo.weekDay(), groupVo.weekDate(), - groupVo.groupDate(), groupVo.startTime(), groupVo.endTime(), groupVo.location() diff --git a/src/main/java/com/ggang/be/api/group/dto/MyGroupResponse.java b/src/main/java/com/ggang/be/api/group/dto/MyGroupResponse.java index 04beefc..468c9f9 100644 --- a/src/main/java/com/ggang/be/api/group/dto/MyGroupResponse.java +++ b/src/main/java/com/ggang/be/api/group/dto/MyGroupResponse.java @@ -3,14 +3,14 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.Status; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.dto.GroupVo; import java.time.LocalDate; public record MyGroupResponse( - long groupId, Status status, Category category, int coverImg, GroupType groupType, - String groupTitle, WeekDate weekDay, LocalDate weekDate, double startTime, double endTime, String location + long groupId, Status status, Category category, int coverImg, GroupType groupType, + String groupTitle, WeekDay weekDay, LocalDate weekDate, double startTime, double endTime, String location ) { public static MyGroupResponse fromGroupVo(GroupVo groupVo) { return new MyGroupResponse( @@ -20,8 +20,8 @@ public static MyGroupResponse fromGroupVo(GroupVo groupVo) { groupVo.coverImg(), groupVo.groupType(), groupVo.groupTitle(), + groupVo.weekDay(), groupVo.weekDate(), - groupVo.groupDate(), groupVo.startTime(), groupVo.endTime(), groupVo.location() diff --git a/src/main/java/com/ggang/be/api/group/dto/NearestGroupResponse.java b/src/main/java/com/ggang/be/api/group/dto/NearestGroupResponse.java index 68ef2ff..3447251 100644 --- a/src/main/java/com/ggang/be/api/group/dto/NearestGroupResponse.java +++ b/src/main/java/com/ggang/be/api/group/dto/NearestGroupResponse.java @@ -2,14 +2,14 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.GroupType; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; public record NearestGroupResponse( long groupId, Category category, GroupType groupType, String groupTitle, - WeekDate weekDay, + WeekDay weekDay, String weekDate, int currentPeopleCount, int maxPeopleCount, diff --git a/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekRequest.java b/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekRequest.java index 9ee72e2..0b2bdf2 100644 --- a/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekRequest.java +++ b/src/main/java/com/ggang/be/api/group/dto/RegisterGongbaekRequest.java @@ -2,7 +2,7 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.GroupType; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.dto.RegisterGroupServiceRequest; import com.ggang.be.domain.timslot.gongbaekTimeSlot.dto.GongbaekTimeSlotRequest; import com.ggang.be.domain.timslot.lectureTimeSlot.dto.LectureTimeSlotRequest; @@ -16,7 +16,7 @@ public record RegisterGongbaekRequest( GroupType groupType, @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate weekDate, - WeekDate weekDay, + WeekDay weekDay, double startTime, double endTime, Category category, @@ -34,7 +34,7 @@ public static LectureTimeSlotRequest toLectureTimeSlotRequest( userEntity, request.startTime(), request.endTime(), - WeekDate.fromDayOfWeek(request.weekDate().getDayOfWeek()) + WeekDay.fromDayOfWeek(request.weekDate().getDayOfWeek()) ); else return LectureTimeSlotRequest.of( @@ -54,7 +54,7 @@ public static GongbaekTimeSlotRequest toGongbaekTimeSlotRequest( userEntity, request.startTime(), request.endTime(), - WeekDate.fromDayOfWeek(request.weekDate().getDayOfWeek()) + WeekDay.fromDayOfWeek(request.weekDate().getDayOfWeek()) ); } else { return new GongbaekTimeSlotRequest( diff --git a/src/main/java/com/ggang/be/api/mapper/GroupResponseMapper.java b/src/main/java/com/ggang/be/api/mapper/GroupResponseMapper.java index cf3a987..9157ee8 100644 --- a/src/main/java/com/ggang/be/api/mapper/GroupResponseMapper.java +++ b/src/main/java/com/ggang/be/api/mapper/GroupResponseMapper.java @@ -43,7 +43,7 @@ public static GroupResponse fromEveryGroup(EveryGroupDto dto) { dto.introduction(), dto.category(), dto.coverImg(), - dto.gongbaekTimeSlotEntity().getWeekDate(), + dto.gongbaekTimeSlotEntity().getWeekDay(), null, dto.gongbaekTimeSlotEntity().getStartTime(), dto.gongbaekTimeSlotEntity().getEndTime() diff --git a/src/main/java/com/ggang/be/api/user/vo/TimeTableVo.java b/src/main/java/com/ggang/be/api/user/vo/TimeTableVo.java index 92a0b82..4960707 100644 --- a/src/main/java/com/ggang/be/api/user/vo/TimeTableVo.java +++ b/src/main/java/com/ggang/be/api/user/vo/TimeTableVo.java @@ -1,9 +1,9 @@ package com.ggang.be.api.user.vo; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.timslot.lectureTimeSlot.vo.LectureTimeSlotVo; -public record TimeTableVo(WeekDate weekDay, +public record TimeTableVo(WeekDay weekDay, Double startTime, Double endTime) { diff --git a/src/main/java/com/ggang/be/domain/constant/WeekDate.java b/src/main/java/com/ggang/be/domain/constant/WeekDay.java similarity index 77% rename from src/main/java/com/ggang/be/domain/constant/WeekDate.java rename to src/main/java/com/ggang/be/domain/constant/WeekDay.java index c8f4a59..dba8a86 100644 --- a/src/main/java/com/ggang/be/domain/constant/WeekDate.java +++ b/src/main/java/com/ggang/be/domain/constant/WeekDay.java @@ -3,7 +3,7 @@ import java.time.DayOfWeek; import java.time.LocalDate; -public enum WeekDate { +public enum WeekDay { MON, TUE, WED, @@ -12,7 +12,7 @@ public enum WeekDate { SAT, SUN; - public static WeekDate fromDayOfWeek(DayOfWeek dayOfWeek) { + public static WeekDay fromDayOfWeek(DayOfWeek dayOfWeek) { return switch (dayOfWeek) { case MONDAY -> MON; case TUESDAY -> TUE; @@ -24,8 +24,8 @@ public static WeekDate fromDayOfWeek(DayOfWeek dayOfWeek) { }; } - public static DayOfWeek getDayOfWeekFromWeekDate(WeekDate weekDate) { - return switch (weekDate) { + public static DayOfWeek getDayOfWeekFromWeekDate(WeekDay weekDay) { + return switch (weekDay) { case MON -> DayOfWeek.MONDAY; case TUE -> DayOfWeek.TUESDAY; case WED -> DayOfWeek.WEDNESDAY; @@ -36,9 +36,9 @@ public static DayOfWeek getDayOfWeekFromWeekDate(WeekDate weekDate) { }; } - public static LocalDate getNextMeetingDate(WeekDate weekDate) { + public static LocalDate getNextMeetingDate(WeekDay weekDay) { LocalDate today = LocalDate.now(); - DayOfWeek targetDay = getDayOfWeekFromWeekDate(weekDate); + DayOfWeek targetDay = getDayOfWeekFromWeekDate(weekDay); LocalDate nextMeetingDate = today; while (nextMeetingDate.getDayOfWeek() != targetDay) { diff --git a/src/main/java/com/ggang/be/domain/group/dto/GroupVo.java b/src/main/java/com/ggang/be/domain/group/dto/GroupVo.java index 5095e40..19db486 100644 --- a/src/main/java/com/ggang/be/domain/group/dto/GroupVo.java +++ b/src/main/java/com/ggang/be/domain/group/dto/GroupVo.java @@ -3,7 +3,7 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.Status; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.everyGroup.dto.EveryGroupVo; import com.ggang.be.domain.group.onceGroup.dto.OnceGroupVo; @@ -12,7 +12,7 @@ public record GroupVo(long groupId, Status status, Category category, int coverImg, int profileImg, String nickname, GroupType groupType, - String groupTitle, WeekDate weekDate, LocalDate groupDate, double startTime, double endTime, String location, LocalDateTime createdAt) { + String groupTitle, WeekDay weekDay, LocalDate weekDate, double startTime, double endTime, String location, LocalDateTime createdAt) { public static GroupVo fromEveryGroup(EveryGroupVo everyGroupVo) { return new GroupVo( @@ -24,7 +24,7 @@ public static GroupVo fromEveryGroup(EveryGroupVo everyGroupVo) { everyGroupVo.nickname(), GroupType.WEEKLY, everyGroupVo.groupTitle(), - everyGroupVo.weekDate(), + everyGroupVo.weekDay(), null, everyGroupVo.startTime(), everyGroupVo.endTime(), @@ -43,7 +43,7 @@ public static GroupVo fromOnceGroup(OnceGroupVo onceGroupVo) { onceGroupVo.nickname(), GroupType.ONCE, onceGroupVo.groupTitle(), - WeekDate.fromDayOfWeek(onceGroupVo.dateTime().getDayOfWeek()), + WeekDay.fromDayOfWeek(onceGroupVo.dateTime().getDayOfWeek()), onceGroupVo.dateTime(), onceGroupVo.startTime(), onceGroupVo.endTime(), diff --git a/src/main/java/com/ggang/be/domain/group/dto/RegisterGroupServiceRequest.java b/src/main/java/com/ggang/be/domain/group/dto/RegisterGroupServiceRequest.java index 193934a..1aef056 100644 --- a/src/main/java/com/ggang/be/domain/group/dto/RegisterGroupServiceRequest.java +++ b/src/main/java/com/ggang/be/domain/group/dto/RegisterGroupServiceRequest.java @@ -2,7 +2,7 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.GroupType; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.user.UserEntity; import java.time.LocalDate; @@ -11,7 +11,7 @@ public record RegisterGroupServiceRequest( UserEntity userEntity, GroupType groupType, LocalDate weekDate, - WeekDate weekDay, + WeekDay weekDay, double startTime, double endTime, Category category, diff --git a/src/main/java/com/ggang/be/domain/group/everyGroup/dto/EveryGroupVo.java b/src/main/java/com/ggang/be/domain/group/everyGroup/dto/EveryGroupVo.java index 8efe105..c195dc7 100644 --- a/src/main/java/com/ggang/be/domain/group/everyGroup/dto/EveryGroupVo.java +++ b/src/main/java/com/ggang/be/domain/group/everyGroup/dto/EveryGroupVo.java @@ -3,14 +3,14 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.GroupType; import com.ggang.be.domain.constant.Status; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.everyGroup.EveryGroupEntity; import java.time.LocalDateTime; public record EveryGroupVo(long groupId, Status status, Category category, int coverImg, int profileImg, String nickname, GroupType groupType, - String groupTitle, WeekDate weekDate, double startTime, double endTime, String location, LocalDateTime createdAt) { + String groupTitle, WeekDay weekDay, double startTime, double endTime, String location, LocalDateTime createdAt) { public static EveryGroupVo of(EveryGroupEntity everyGroupEntity) { return new EveryGroupVo( everyGroupEntity.getId(), @@ -21,7 +21,7 @@ public static EveryGroupVo of(EveryGroupEntity everyGroupEntity) { everyGroupEntity.getUserEntity().getNickname(), GroupType.WEEKLY, everyGroupEntity.getTitle(), - everyGroupEntity.getGongbaekTimeSlotEntity().getWeekDate(), + everyGroupEntity.getGongbaekTimeSlotEntity().getWeekDay(), everyGroupEntity.getGongbaekTimeSlotEntity().getStartTime(), everyGroupEntity.getGongbaekTimeSlotEntity().getEndTime(), everyGroupEntity.getLocation(), diff --git a/src/main/java/com/ggang/be/domain/group/everyGroup/infra/EveryGroupRepository.java b/src/main/java/com/ggang/be/domain/group/everyGroup/infra/EveryGroupRepository.java index ac6ea27..77dcf6c 100644 --- a/src/main/java/com/ggang/be/domain/group/everyGroup/infra/EveryGroupRepository.java +++ b/src/main/java/com/ggang/be/domain/group/everyGroup/infra/EveryGroupRepository.java @@ -2,7 +2,7 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.Status; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.everyGroup.EveryGroupEntity; import com.ggang.be.domain.user.UserEntity; import jakarta.persistence.LockModeType; @@ -18,7 +18,7 @@ public interface EveryGroupRepository extends JpaRepository 0 THEN TRUE ELSE FALSE END " + "FROM every_group o " + "WHERE o.userEntity = :userEntity " + - "AND o.gongbaekTimeSlotEntity.weekDate = :weekDate " + + "AND o.gongbaekTimeSlotEntity.weekDay = :weekDay " + "AND o.status != :status " + "AND (" + " (o.gongbaekTimeSlotEntity.startTime <= :startTime AND o.gongbaekTimeSlotEntity.endTime > :startTime) " + @@ -26,7 +26,7 @@ public interface EveryGroupRepository extends JpaRepository :startTime AND o.gongbaekTimeSlotEntity.endTime < :endTime)" + ")") boolean isInTime(UserEntity userEntity, double startTime, double endTime, - WeekDate weekDate, Status status); + WeekDay weekDay, Status status); @Lock(LockModeType.PESSIMISTIC_WRITE) @Query("select o from every_group o join fetch o.gongbaekTimeSlotEntity where o.status!=:status") diff --git a/src/main/java/com/ggang/be/domain/group/onceGroup/dto/OnceGroupDto.java b/src/main/java/com/ggang/be/domain/group/onceGroup/dto/OnceGroupDto.java index 4112af9..4a743bc 100644 --- a/src/main/java/com/ggang/be/domain/group/onceGroup/dto/OnceGroupDto.java +++ b/src/main/java/com/ggang/be/domain/group/onceGroup/dto/OnceGroupDto.java @@ -2,7 +2,7 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.Status; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.onceGroup.OnceGroupEntity; import com.ggang.be.domain.timslot.gongbaekTimeSlot.GongbaekTimeSlotEntity; import com.ggang.be.domain.user.UserEntity; @@ -19,7 +19,7 @@ public record OnceGroupDto( String introduction, Category category, int coverImg, - WeekDate weekDay, + WeekDay weekDay, String weekDate, GongbaekTimeSlotEntity gongbaekTimeSlotEntity ) { @@ -37,12 +37,12 @@ public static OnceGroupDto toDto(OnceGroupEntity entity, UserEntity currentUser) entity.getIntroduction(), entity.getCategory(), entity.getCoverImg(), - WeekDate.fromDayOfWeek(entity.getGroupDate().getDayOfWeek()), + WeekDay.fromDayOfWeek(entity.getGroupDate().getDayOfWeek()), entity.getGroupDate().toString(), GongbaekTimeSlotEntity.builder() .startTime(entity.getGongbaekTimeSlotEntity().getStartTime()) .endTime(entity.getGongbaekTimeSlotEntity().getEndTime()) - .weekDate(WeekDate.fromDayOfWeek(entity.getGroupDate().getDayOfWeek())) + .weekDay(WeekDay.fromDayOfWeek(entity.getGroupDate().getDayOfWeek())) .userEntity(currentUser) .build() ); diff --git a/src/main/java/com/ggang/be/domain/group/vo/NearestGroup.java b/src/main/java/com/ggang/be/domain/group/vo/NearestGroup.java index 48a65f9..3384242 100644 --- a/src/main/java/com/ggang/be/domain/group/vo/NearestGroup.java +++ b/src/main/java/com/ggang/be/domain/group/vo/NearestGroup.java @@ -2,7 +2,7 @@ import com.ggang.be.domain.constant.Category; import com.ggang.be.domain.constant.GroupType; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.everyGroup.EveryGroupEntity; import com.ggang.be.domain.group.onceGroup.OnceGroupEntity; import java.time.LocalDate; @@ -11,7 +11,7 @@ public record NearestGroup(long groupId, Category category, GroupType groupType, String groupTitle, - WeekDate weekDay, + WeekDay weekDay, LocalDate weekDate, int currentPeopleCount, int maxPeopleCount, @@ -25,8 +25,8 @@ public static NearestGroup fromEveryEntity(EveryGroupEntity entity){ entity.getCategory(), GroupType.WEEKLY, entity.getTitle(), - entity.getGongbaekTimeSlotEntity().getWeekDate(), - WeekDate.getNextMeetingDate(entity.getGongbaekTimeSlotEntity().getWeekDate()), + entity.getGongbaekTimeSlotEntity().getWeekDay(), + WeekDay.getNextMeetingDate(entity.getGongbaekTimeSlotEntity().getWeekDay()), entity.getCurrentPeopleCount(), entity.getMaxPeopleCount(), entity.getGongbaekTimeSlotEntity().getStartTime(), @@ -41,7 +41,7 @@ public static NearestGroup fromOnceEntity(OnceGroupEntity entity){ entity.getCategory(), GroupType.ONCE, entity.getTitle(), - WeekDate.fromDayOfWeek(entity.getGroupDate().getDayOfWeek()), + WeekDay.fromDayOfWeek(entity.getGroupDate().getDayOfWeek()), entity.getGroupDate(), entity.getCurrentPeopleCount(), entity.getMaxPeopleCount(), diff --git a/src/main/java/com/ggang/be/domain/timslot/ReadCommonInvalidTimeVoMaker.java b/src/main/java/com/ggang/be/domain/timslot/ReadCommonInvalidTimeVoMaker.java index 963dce7..9524ebe 100644 --- a/src/main/java/com/ggang/be/domain/timslot/ReadCommonInvalidTimeVoMaker.java +++ b/src/main/java/com/ggang/be/domain/timslot/ReadCommonInvalidTimeVoMaker.java @@ -12,7 +12,7 @@ public static List convertToCommonResponse( List lectureTimeSlotEntities) { AtomicInteger atomicInteger = new AtomicInteger(0); return lectureTimeSlotEntities.stream() - .sorted(Comparator.comparing(LectureTimeSlotEntity::getWeekDate)) + .sorted(Comparator.comparing(LectureTimeSlotEntity::getWeekDay)) .map(entity -> makeReadCommonInvalidTimeVo(entity, atomicInteger)) .sorted(Comparator.comparing(ReadCommonInvalidTimeVo::idx)).toList(); } diff --git a/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/GongbaekTimeSlotEntity.java b/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/GongbaekTimeSlotEntity.java index 31e9fe4..d2a7215 100644 --- a/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/GongbaekTimeSlotEntity.java +++ b/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/GongbaekTimeSlotEntity.java @@ -1,7 +1,7 @@ package com.ggang.be.domain.timslot.gongbaekTimeSlot; import com.ggang.be.domain.BaseTimeEntity; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.user.UserEntity; import jakarta.persistence.*; import lombok.AccessLevel; @@ -19,7 +19,7 @@ public class GongbaekTimeSlotEntity extends BaseTimeEntity { @Column(nullable = false) @Enumerated(EnumType.STRING) - private WeekDate weekDate; + private WeekDay weekDay; private double startTime; private double endTime; @@ -30,9 +30,9 @@ public class GongbaekTimeSlotEntity extends BaseTimeEntity { @Builder private GongbaekTimeSlotEntity( - WeekDate weekDate, double startTime, double endTime, UserEntity userEntity + WeekDay weekDay, double startTime, double endTime, UserEntity userEntity ) { - this.weekDate = weekDate; + this.weekDay = weekDay; this.startTime = startTime; this.endTime = endTime; this.userEntity = userEntity; diff --git a/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/application/GongbaekTimeSlotServiceImpl.java b/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/application/GongbaekTimeSlotServiceImpl.java index 232d3e0..9a5aa3b 100644 --- a/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/application/GongbaekTimeSlotServiceImpl.java +++ b/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/application/GongbaekTimeSlotServiceImpl.java @@ -24,7 +24,7 @@ public GongbaekTimeSlotEntity registerGongbaekTimeSlot(UserEntity userEntity, Go .userEntity(userEntity) .startTime(dto.startTime()) .endTime(dto.endTime()) - .weekDate(dto.weekDay()) + .weekDay(dto.weekDay()) .build(); return gongbaekTimeSlotRepository.save(buildEntity); diff --git a/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/dto/GongbaekTimeSlotRequest.java b/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/dto/GongbaekTimeSlotRequest.java index 75ba866..740ba2d 100644 --- a/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/dto/GongbaekTimeSlotRequest.java +++ b/src/main/java/com/ggang/be/domain/timslot/gongbaekTimeSlot/dto/GongbaekTimeSlotRequest.java @@ -1,7 +1,7 @@ package com.ggang.be.domain.timslot.gongbaekTimeSlot.dto; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.user.UserEntity; -public record GongbaekTimeSlotRequest(UserEntity userEntity, double startTime, double endTime, WeekDate weekDay) { +public record GongbaekTimeSlotRequest(UserEntity userEntity, double startTime, double endTime, WeekDay weekDay) { } diff --git a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/LectureTimeSlotEntity.java b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/LectureTimeSlotEntity.java index fcebb59..7185f5a 100644 --- a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/LectureTimeSlotEntity.java +++ b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/LectureTimeSlotEntity.java @@ -2,7 +2,7 @@ import com.ggang.be.domain.BaseTimeEntity; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.user.UserEntity; import jakarta.persistence.*; import lombok.AccessLevel; @@ -20,7 +20,7 @@ public class LectureTimeSlotEntity extends BaseTimeEntity { @Column(nullable = false) @Enumerated(value = EnumType.STRING) - private WeekDate weekDate; + private WeekDay weekDay; private double startTime; private double endTime; @@ -30,9 +30,9 @@ public class LectureTimeSlotEntity extends BaseTimeEntity { private UserEntity userEntity; @Builder - private LectureTimeSlotEntity(WeekDate weekDate, double startTime, double endTime, + private LectureTimeSlotEntity(WeekDay weekDay, double startTime, double endTime, UserEntity userEntity) { - this.weekDate = weekDate; + this.weekDay = weekDay; this.startTime = startTime; this.endTime = endTime; this.userEntity = userEntity; diff --git a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/application/LectureTimeSlotServiceImpl.java b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/application/LectureTimeSlotServiceImpl.java index 6c12ef4..4fa6bae 100644 --- a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/application/LectureTimeSlotServiceImpl.java +++ b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/application/LectureTimeSlotServiceImpl.java @@ -32,7 +32,7 @@ public void saveLectureTimeSlot(List timeTableVos, UserEntity @Override public void isExistInLectureTImeSlot(UserEntity findUserEntity, LectureTimeSlotRequest dto) { if(lectureTimeSlotRepository.isInTime( - dto.startTime(), dto.endTime(), findUserEntity, dto.weekDate() + dto.startTime(), dto.endTime(), findUserEntity, dto.weekDay() )) throw new GongBaekException(ResponseError.TIME_SLOT_ALREADY_EXIST); } @@ -43,7 +43,7 @@ public boolean isActiveGroupsInLectureTimeSlot(UserEntity findUserEntity, GroupV groupVo.startTime(), groupVo.endTime(), findUserEntity, - groupVo.weekDate()); + groupVo.weekDay()); } @Override diff --git a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/dto/LectureTimeSlotRequest.java b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/dto/LectureTimeSlotRequest.java index 78f4325..49007f3 100644 --- a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/dto/LectureTimeSlotRequest.java +++ b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/dto/LectureTimeSlotRequest.java @@ -1,11 +1,11 @@ package com.ggang.be.domain.timslot.lectureTimeSlot.dto; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.user.UserEntity; -public record LectureTimeSlotRequest(UserEntity userEntity, double startTime, double endTime, WeekDate weekDate) { +public record LectureTimeSlotRequest(UserEntity userEntity, double startTime, double endTime, WeekDay weekDay) { - public static LectureTimeSlotRequest of(UserEntity userEntity, double startTime, double endTime, WeekDate weekDate) { - return new LectureTimeSlotRequest(userEntity, startTime, endTime, weekDate); + public static LectureTimeSlotRequest of(UserEntity userEntity, double startTime, double endTime, WeekDay weekDay) { + return new LectureTimeSlotRequest(userEntity, startTime, endTime, weekDay); } } diff --git a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/infra/LectureTimeSlotRepository.java b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/infra/LectureTimeSlotRepository.java index 76bf23e..ce74fd4 100644 --- a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/infra/LectureTimeSlotRepository.java +++ b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/infra/LectureTimeSlotRepository.java @@ -1,6 +1,6 @@ package com.ggang.be.domain.timslot.lectureTimeSlot.infra; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.timslot.lectureTimeSlot.LectureTimeSlotEntity; import com.ggang.be.domain.user.UserEntity; import org.springframework.data.jpa.repository.JpaRepository; @@ -13,13 +13,13 @@ public interface LectureTimeSlotRepository extends JpaRepository 0 THEN TRUE ELSE FALSE END " + "FROM lecture_time_slot l " + "WHERE l.userEntity = :userEntity " + - "AND l.weekDate = :weekDate " + + "AND l.weekDay = :weekDay " + "AND (" + " (l.startTime <= :startTime AND l.endTime > :startTime) " + " OR (l.startTime < :endTime AND l.endTime >= :endTime) " + " OR (l.startTime > :startTime AND l.endTime < :endTime)" + ")") - boolean isInTime(double startTime, double endTime, UserEntity userEntity, WeekDate weekDate); + boolean isInTime(double startTime, double endTime, UserEntity userEntity, WeekDay weekDay); List findAllByUserEntity(UserEntity userEntity); } diff --git a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/vo/LectureTimeSlotVo.java b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/vo/LectureTimeSlotVo.java index 698f822..d78c495 100644 --- a/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/vo/LectureTimeSlotVo.java +++ b/src/main/java/com/ggang/be/domain/timslot/lectureTimeSlot/vo/LectureTimeSlotVo.java @@ -1,14 +1,14 @@ package com.ggang.be.domain.timslot.lectureTimeSlot.vo; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.timslot.lectureTimeSlot.LectureTimeSlotEntity; import com.ggang.be.domain.user.UserEntity; -public record LectureTimeSlotVo(WeekDate weekDate, Double startTime, Double endTime) { +public record LectureTimeSlotVo(WeekDay weekDay, Double startTime, Double endTime) { public static LectureTimeSlotEntity toEntity(LectureTimeSlotVo lectureTimeSlotVo, UserEntity userEntity) { return LectureTimeSlotEntity.builder(). - weekDate(lectureTimeSlotVo.weekDate()). + weekDay(lectureTimeSlotVo.weekDay()). startTime(lectureTimeSlotVo.startTime()). endTime(lectureTimeSlotVo.endTime()). userEntity(userEntity). diff --git a/src/main/java/com/ggang/be/domain/timslot/vo/ReadCommonInvalidTimeVo.java b/src/main/java/com/ggang/be/domain/timslot/vo/ReadCommonInvalidTimeVo.java index 4a7428e..9e343a5 100644 --- a/src/main/java/com/ggang/be/domain/timslot/vo/ReadCommonInvalidTimeVo.java +++ b/src/main/java/com/ggang/be/domain/timslot/vo/ReadCommonInvalidTimeVo.java @@ -1,18 +1,18 @@ package com.ggang.be.domain.timslot.vo; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.timslot.lectureTimeSlot.LectureTimeSlotEntity; public record ReadCommonInvalidTimeVo( int idx, - WeekDate weekDay, + WeekDay weekDay, double startTime, double endTime ) { public static ReadCommonInvalidTimeVo fromLectureEntity( int idx, LectureTimeSlotEntity lectureTimeSlotEntity) { - return new ReadCommonInvalidTimeVo(idx, lectureTimeSlotEntity.getWeekDate(), + return new ReadCommonInvalidTimeVo(idx, lectureTimeSlotEntity.getWeekDay(), lectureTimeSlotEntity.getStartTime(), lectureTimeSlotEntity.getEndTime()); } } diff --git a/src/main/java/com/ggang/be/domain/userEveryGroup/application/UserEveryGroupServiceImpl.java b/src/main/java/com/ggang/be/domain/userEveryGroup/application/UserEveryGroupServiceImpl.java index 04434c7..6ff76e4 100644 --- a/src/main/java/com/ggang/be/domain/userEveryGroup/application/UserEveryGroupServiceImpl.java +++ b/src/main/java/com/ggang/be/domain/userEveryGroup/application/UserEveryGroupServiceImpl.java @@ -5,7 +5,7 @@ import com.ggang.be.api.exception.GongBaekException; import com.ggang.be.domain.group.vo.NearestGroup; import com.ggang.be.api.userEveryGroup.service.UserEveryGroupService; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.group.GroupVoMaker; import com.ggang.be.domain.group.dto.ReadEveryGroupMember; import com.ggang.be.domain.group.everyGroup.EveryGroupEntity; @@ -105,7 +105,7 @@ public void isValidCommentAccess(UserEntity userEntity, final long groupId) { private EveryGroupEntity getNearestGroup(List groups) { return groups.stream() - .min(Comparator.comparing(group -> WeekDate.getNextMeetingDate(group.getGongbaekTimeSlotEntity().getWeekDate()))) + .min(Comparator.comparing(group -> WeekDay.getNextMeetingDate(group.getGongbaekTimeSlotEntity().getWeekDay()))) .orElse(null); } diff --git a/src/main/java/com/ggang/be/global/util/TimeValidator.java b/src/main/java/com/ggang/be/global/util/TimeValidator.java index 74d6719..6467dcd 100644 --- a/src/main/java/com/ggang/be/global/util/TimeValidator.java +++ b/src/main/java/com/ggang/be/global/util/TimeValidator.java @@ -2,16 +2,16 @@ import com.ggang.be.api.common.ResponseError; import com.ggang.be.api.exception.GongBaekException; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import lombok.extern.slf4j.Slf4j; import java.time.LocalDate; @Slf4j public class TimeValidator { - public static void isWeekDateRight(WeekDate writeWeekDay, LocalDate writeDate) { - WeekDate realWeekDate = WeekDate.fromDayOfWeek(writeDate.getDayOfWeek()); - if(!realWeekDate.equals(writeWeekDay)) { + public static void isWeekDateRight(WeekDay writeWeekDay, LocalDate writeDate) { + WeekDay realWeekDay = WeekDay.fromDayOfWeek(writeDate.getDayOfWeek()); + if(!realWeekDay.equals(writeWeekDay)) { log.error("weekDate and weekDay is not same"); throw new GongBaekException(ResponseError.BAD_REQUEST); } diff --git a/src/test/java/com/ggang/be/domain/gongbaekTImeSlot/GongbaekTimeSlotFixture.java b/src/test/java/com/ggang/be/domain/gongbaekTImeSlot/GongbaekTimeSlotFixture.java index 6bbe6cc..05cf0cb 100644 --- a/src/test/java/com/ggang/be/domain/gongbaekTImeSlot/GongbaekTimeSlotFixture.java +++ b/src/test/java/com/ggang/be/domain/gongbaekTImeSlot/GongbaekTimeSlotFixture.java @@ -1,6 +1,6 @@ package com.ggang.be.domain.gongbaekTImeSlot; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.timslot.gongbaekTimeSlot.GongbaekTimeSlotEntity; public class GongbaekTimeSlotFixture { @@ -9,7 +9,7 @@ public static GongbaekTimeSlotEntity getTestGongbaekTimeSlot() { return GongbaekTimeSlotEntity.builder() .startTime(10) .endTime(12) - .weekDate(WeekDate.MON) + .weekDate(WeekDay.MON) .build(); } diff --git a/src/test/java/com/ggang/be/domain/lectureTimeSlot/application/LectureTimeSlotServiceImplTest.java b/src/test/java/com/ggang/be/domain/lectureTimeSlot/application/LectureTimeSlotServiceImplTest.java index bc7c2db..c9e458a 100644 --- a/src/test/java/com/ggang/be/domain/lectureTimeSlot/application/LectureTimeSlotServiceImplTest.java +++ b/src/test/java/com/ggang/be/domain/lectureTimeSlot/application/LectureTimeSlotServiceImplTest.java @@ -6,7 +6,7 @@ import com.ggang.be.domain.constant.Gender; import com.ggang.be.domain.constant.Mbti; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.lectureTimeSlot.fixture.LectureTimeSlotFixture; import com.ggang.be.domain.timslot.lectureTimeSlot.LectureTimeSlotEntity; import com.ggang.be.domain.timslot.lectureTimeSlot.application.LectureTimeSlotServiceImpl; @@ -53,9 +53,9 @@ void saveLectureTimeSlot() { .build(); List lectureTimeSlotVos = List.of( - new LectureTimeSlotVo(WeekDate.MON, 9.0, 10.5), - new LectureTimeSlotVo(WeekDate.WED, 14.0, 15.5), - new LectureTimeSlotVo(WeekDate.FRI, 16.0, 17.0) + new LectureTimeSlotVo(WeekDay.MON, 9.0, 10.5), + new LectureTimeSlotVo(WeekDay.WED, 14.0, 15.5), + new LectureTimeSlotVo(WeekDay.FRI, 16.0, 17.0) ); List list = lectureTimeSlotVos.stream() diff --git a/src/test/java/com/ggang/be/domain/lectureTimeSlot/fixture/LectureTimeSlotFixture.java b/src/test/java/com/ggang/be/domain/lectureTimeSlot/fixture/LectureTimeSlotFixture.java index fbdf38b..e70e06f 100644 --- a/src/test/java/com/ggang/be/domain/lectureTimeSlot/fixture/LectureTimeSlotFixture.java +++ b/src/test/java/com/ggang/be/domain/lectureTimeSlot/fixture/LectureTimeSlotFixture.java @@ -1,6 +1,6 @@ package com.ggang.be.domain.lectureTimeSlot.fixture; -import com.ggang.be.domain.constant.WeekDate; +import com.ggang.be.domain.constant.WeekDay; import com.ggang.be.domain.timslot.lectureTimeSlot.LectureTimeSlotEntity; import com.ggang.be.domain.user.fixture.UserEntityFixture; @@ -8,7 +8,7 @@ public class LectureTimeSlotFixture { public static LectureTimeSlotEntity makeLectureTimeSlotEntity() { return LectureTimeSlotEntity.builder() - .weekDate(WeekDate.MON) + .weekDate(WeekDay.MON) .startTime(9.0) .endTime(10.0) .userEntity(UserEntityFixture.create()) From ad27991ff965edb8d1ba680d112fc8db536a12ae Mon Sep 17 00:00:00 2001 From: Khyojun Date: Thu, 23 Jan 2025 00:39:35 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[fix]=20#166=20test=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=ED=95=84=EB=93=9C=EB=AA=85=20=EC=BB=B4=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EA=B4=80=EB=A0=A8=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../be/domain/gongbaekTImeSlot/GongbaekTimeSlotFixture.java | 2 +- .../domain/lectureTimeSlot/fixture/LectureTimeSlotFixture.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/ggang/be/domain/gongbaekTImeSlot/GongbaekTimeSlotFixture.java b/src/test/java/com/ggang/be/domain/gongbaekTImeSlot/GongbaekTimeSlotFixture.java index 05cf0cb..80bed54 100644 --- a/src/test/java/com/ggang/be/domain/gongbaekTImeSlot/GongbaekTimeSlotFixture.java +++ b/src/test/java/com/ggang/be/domain/gongbaekTImeSlot/GongbaekTimeSlotFixture.java @@ -9,7 +9,7 @@ public static GongbaekTimeSlotEntity getTestGongbaekTimeSlot() { return GongbaekTimeSlotEntity.builder() .startTime(10) .endTime(12) - .weekDate(WeekDay.MON) + .weekDay(WeekDay.MON) .build(); } diff --git a/src/test/java/com/ggang/be/domain/lectureTimeSlot/fixture/LectureTimeSlotFixture.java b/src/test/java/com/ggang/be/domain/lectureTimeSlot/fixture/LectureTimeSlotFixture.java index e70e06f..8aa4c51 100644 --- a/src/test/java/com/ggang/be/domain/lectureTimeSlot/fixture/LectureTimeSlotFixture.java +++ b/src/test/java/com/ggang/be/domain/lectureTimeSlot/fixture/LectureTimeSlotFixture.java @@ -8,7 +8,7 @@ public class LectureTimeSlotFixture { public static LectureTimeSlotEntity makeLectureTimeSlotEntity() { return LectureTimeSlotEntity.builder() - .weekDate(WeekDay.MON) + .weekDay(WeekDay.MON) .startTime(9.0) .endTime(10.0) .userEntity(UserEntityFixture.create())