diff --git a/application/wypl-core/build.gradle b/application/wypl-core/build.gradle index a3812d6..9c9fef0 100644 --- a/application/wypl-core/build.gradle +++ b/application/wypl-core/build.gradle @@ -9,4 +9,8 @@ java { dependencies { implementation project(':application:application-common') + implementation project(':common') + implementation project(':domain:jpa-common') + implementation project(':domain:jpa-member-domain') + implementation project(':domain:jpa-calendar-domain') } \ No newline at end of file diff --git a/application/wypl-core/src/main/java/com/wypl/WyplCoreApplication.java b/application/wypl-core/src/main/java/com/wypl/WyplCoreApplication.java new file mode 100644 index 0000000..82bafa3 --- /dev/null +++ b/application/wypl-core/src/main/java/com/wypl/WyplCoreApplication.java @@ -0,0 +1,15 @@ +package com.wypl; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.jpa.repository.config.EnableJpaRepositories; + +@SpringBootApplication +@EnableJpaRepositories(basePackages = {"com.wypl"}) +public class WyplCoreApplication { + + public static void main(String[] args) { + SpringApplication.run(WyplCoreApplication.class, args); + } + +} diff --git a/application/wypl-core/src/main/java/com/wypl/wyplcore/WyplColorApplication.java b/application/wypl-core/src/main/java/com/wypl/wyplcore/WyplColorApplication.java deleted file mode 100644 index 0950424..0000000 --- a/application/wypl-core/src/main/java/com/wypl/wyplcore/WyplColorApplication.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.wypl.wyplcore; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class WyplColorApplication { - - public static void main(String[] args) { - SpringApplication.run(WyplColorApplication.class, args); - } - -} diff --git a/application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/data/request/ScheduleCreateRequest.java b/application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/data/request/ScheduleCreateRequest.java new file mode 100644 index 0000000..2d8852a --- /dev/null +++ b/application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/data/request/ScheduleCreateRequest.java @@ -0,0 +1,17 @@ +package com.wypl.wyplcore.schedule.data.request; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Builder; + +@Builder +public record ScheduleCreateRequest( + + @JsonProperty("calendar_id") + long calenderId, + + @JsonProperty("schedule_request") + ScheduleRequest scheduleRequest + +) { + +} \ No newline at end of file diff --git a/application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/data/request/ScheduleRequest.java b/application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/data/request/ScheduleRequest.java new file mode 100644 index 0000000..c92266a --- /dev/null +++ b/application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/data/request/ScheduleRequest.java @@ -0,0 +1,82 @@ +package com.wypl.wyplcore.schedule.data.request; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.wypl.jpacalendardomain.calendar.data.ConvertibleSchedule; +import com.wypl.jpacalendardomain.calendar.data.RepetitionCycle; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +public record ScheduleRequest ( + + String title, + + String description, + + @JsonProperty("start_datetime") + LocalDateTime startDateTime, + + @JsonProperty("end_datetime") + LocalDateTime endDateTime, + + @JsonProperty("repetition_cycle") + RepetitionCycle repetitionCycle, + + @JsonProperty("day_of_week") + int dayOfWeek, + + @JsonProperty("week_interval") + Integer weekInterval, + + @JsonProperty("repetition_start_date") + LocalDate repetitionStartDate, + + @JsonProperty("repetition_end_date") + LocalDate repetitionEndDate + +) implements ConvertibleSchedule { + @Override + public String getTitle() { + return this.title; + } + + @Override + public String getDescription() { + return this.description; + } + + @Override + public LocalDateTime getStartDateTime() { + return this.startDateTime; + } + + @Override + public LocalDateTime getEndDateTime() { + return this.endDateTime; + } + + @Override + public LocalDate getRepetitionStartDate() { + return this.repetitionStartDate; + } + + @Override + public LocalDate getRepetitionEndDate() { + return this.repetitionEndDate; + } + + @Override + public RepetitionCycle getRepetitionCycle() { + return this.repetitionCycle; + } + + @Override + public Integer getDayOfWeek() { + return this.dayOfWeek; + } + + @Override + public Integer getWeekInterval() { + return this.weekInterval; + } +} diff --git a/application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/service/ScheduleService.java b/application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/service/ScheduleService.java new file mode 100644 index 0000000..b22f093 --- /dev/null +++ b/application/wypl-core/src/main/java/com/wypl/wyplcore/schedule/service/ScheduleService.java @@ -0,0 +1,25 @@ +package com.wypl.wyplcore.schedule.service; + +import com.wypl.jpacalendardomain.calendar.domain.Calendar; +import com.wypl.jpacalendardomain.calendar.domain.ScheduleInfo; +import com.wypl.jpacalendardomain.calendar.repository.ScheduleInfoRepository; +import com.wypl.jpacalendardomain.calendar.repository.ScheduleRepository; +import com.wypl.wyplcore.schedule.data.request.ScheduleCreateRequest; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class ScheduleService { + + private final ScheduleRepository scheduleRepository; + private final ScheduleInfoRepository scheduleInfoRepository; + + public void createSchedule(long memberId, ScheduleCreateRequest scheduleCreateRequest) { + + //Schedule, ScheduleInfo 생성 + Calendar calendar = null; // FIXME: scheduleInfoRequest의 calendarId로 찾는다. + ScheduleInfo scheduleInfo = null; + + } +} diff --git a/application/wypl-core/src/main/resources/application.properties b/application/wypl-core/src/main/resources/application.properties deleted file mode 100644 index 15afd6e..0000000 --- a/application/wypl-core/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -spring.application.name=wypl-calendar diff --git a/application/wypl-core/src/main/resources/application.yml b/application/wypl-core/src/main/resources/application.yml new file mode 100644 index 0000000..01132f8 --- /dev/null +++ b/application/wypl-core/src/main/resources/application.yml @@ -0,0 +1,19 @@ +spring: + application: + name: wypl-core + jpa: + properties: + hibernate: + show_sql: true + format_sql: true + hibernate: + ddl-auto: create-drop + datasource: + driver-class-name: org.h2.Driver + url: jdbc:h2:mem:db + username: sa + password: + h2: + console: + enabled: true + path: /h2 diff --git a/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java b/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java index ab0ded3..f498779 100644 --- a/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java +++ b/common/src/main/java/com/wypl/common/exception/GlobalErrorCode.java @@ -8,7 +8,7 @@ public enum GlobalErrorCode implements ServerErrorCode { private final String errorCode; private final String message; - private GlobalErrorCode(int statusCode, String errorCode, String message) { + GlobalErrorCode(int statusCode, String errorCode, String message) { this.statusCode = statusCode; this.errorCode = errorCode; this.message = message; diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/data/ConvertibleSchedule.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/data/ConvertibleSchedule.java new file mode 100644 index 0000000..1ac9c06 --- /dev/null +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/data/ConvertibleSchedule.java @@ -0,0 +1,25 @@ +package com.wypl.jpacalendardomain.calendar.data; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +public interface ConvertibleSchedule { + + String getTitle(); + + String getDescription(); + + LocalDateTime getStartDateTime(); + + LocalDateTime getEndDateTime(); + + LocalDate getRepetitionStartDate(); + + LocalDate getRepetitionEndDate(); + + RepetitionCycle getRepetitionCycle(); + + Integer getDayOfWeek(); + + Integer getWeekInterval(); +} diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/data/ConvertibleScheduleInfo.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/data/ConvertibleScheduleInfo.java new file mode 100644 index 0000000..b5779e5 --- /dev/null +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/data/ConvertibleScheduleInfo.java @@ -0,0 +1,7 @@ +package com.wypl.jpacalendardomain.calendar.data; + +public interface ConvertibleScheduleInfo { + + Long getCreatorId(); + +} diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/data/RepetitionCycle.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/data/RepetitionCycle.java similarity index 59% rename from domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/data/RepetitionCycle.java rename to domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/data/RepetitionCycle.java index 475fa07..8f74c36 100644 --- a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/data/RepetitionCycle.java +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/data/RepetitionCycle.java @@ -1,4 +1,4 @@ -package com.wypl.jpacalendardomain.schedule.data; +package com.wypl.jpacalendardomain.calendar.data; public enum RepetitionCycle { DAY, diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/Calendar.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/Calendar.java index c6dc4ef..0662989 100644 --- a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/Calendar.java +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/Calendar.java @@ -1,28 +1,23 @@ package com.wypl.jpacalendardomain.calendar.domain; +import com.wypl.jpacommon.JpaBaseEntity; +import jakarta.persistence.*; import org.hibernate.annotations.SQLRestriction; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.Table; import lombok.AccessLevel; -import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -@Builder +import java.util.List; + @Getter -@AllArgsConstructor @NoArgsConstructor(access = AccessLevel.PROTECTED) @SQLRestriction("deleted_at is null") @Entity -@Table(name = "calendar") -public class Calendar { - // Todo : extends BaseEntity +@Table(name = "calendar_tbl") +public class Calendar extends JpaBaseEntity { + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "calendar_id") @@ -37,6 +32,21 @@ public class Calendar { @Column(name = "owner_id") private Long ownerId; - // Todo : boolean type 설정 - // private Boolean isShared; + @OneToMany(mappedBy = "calendar") + private List scheduleInfos; + + @OneToMany(mappedBy = "calendar") + private List memberCalendars; + + @Column(name = "is_shared") + private Boolean isShared; + + @Builder + public Calendar(String name, String description, Long ownerId, List scheduleInfos, Boolean isShared) { + this.name = name; + this.description = description; + this.ownerId = ownerId; + this.scheduleInfos = scheduleInfos; + this.isShared = isShared; + } } diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/MemberCalendar.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/MemberCalendar.java index 7e47593..e783ccd 100644 --- a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/MemberCalendar.java +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/MemberCalendar.java @@ -1,5 +1,6 @@ package com.wypl.jpacalendardomain.calendar.domain; +import com.wypl.jpacommon.JpaBaseEntity; import org.hibernate.annotations.SQLRestriction; import com.wypl.common.Color; @@ -29,9 +30,8 @@ @SQLRestriction("deleted_at is null") @Entity @IdClass(MemberCalendarId.class) -@Table(name = "member_calendar") -public class MemberCalendar { - // Todo : extends BaseEntity +@Table(name = "member_calendar_tbl") +public class MemberCalendar extends JpaBaseEntity { @Id @ManyToOne(fetch = FetchType.LAZY) diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/Schedule.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/Schedule.java new file mode 100644 index 0000000..82a5051 --- /dev/null +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/Schedule.java @@ -0,0 +1,70 @@ +package com.wypl.jpacalendardomain.calendar.domain; + +import com.wypl.jpacalendardomain.calendar.data.RepetitionCycle; +import com.wypl.jpacommon.JpaBaseEntity; +import jakarta.persistence.*; +import lombok.*; +import org.hibernate.annotations.SQLRestriction; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@SQLRestriction("deleted_at is null") +@Entity +@Table(name = "schedule_tbl") +public class Schedule extends JpaBaseEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "schedule_id") + private Long scheduleId; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "schedule_info_id", nullable = false) + private ScheduleInfo scheduleInfo; + + @Column(name = "title", length = 100) + private String title; + + @Column(name = "description") + private String description; + + @Column(name = "start_datetime", nullable = false) + private LocalDateTime startDateTime; + + @Column(name = "end_datetime", nullable = false) + private LocalDateTime endDateTime; + + @Column(name = "repetition_start_date", nullable = false) + private LocalDate repetitionStartDate; + + @Column(name = "repetition_end_date") + private LocalDate repetitionEndDate; + + @Enumerated(EnumType.STRING) + private RepetitionCycle repetitionCycle; // 반복 주기 (일, 주, 달, 년) + + @Column(name = "day_of_week") + private Integer dayOfWeek; // 반복 요일 + + @Column(name = "week_interval") + private Integer weekInterval; // 주 반복 + + // Todo: Review Mapping + + @Builder + public Schedule(ScheduleInfo scheduleInfo, String title, String description, LocalDateTime startDateTime, LocalDateTime endDateTime, LocalDate repetitionStartDate, LocalDate repetitionEndDate, RepetitionCycle repetitionCycle, Integer dayOfWeek, Integer weekInterval) { + this.scheduleInfo = scheduleInfo; + this.title = title; + this.description = description; + this.startDateTime = startDateTime; + this.endDateTime = endDateTime; + this.repetitionStartDate = repetitionStartDate; + this.repetitionEndDate = repetitionEndDate; + this.repetitionCycle = repetitionCycle; + this.dayOfWeek = dayOfWeek; + this.weekInterval = weekInterval; + } +} diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/domain/ScheduleInfo.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/ScheduleInfo.java similarity index 52% rename from domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/domain/ScheduleInfo.java rename to domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/ScheduleInfo.java index 2849368..aba95b1 100644 --- a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/domain/ScheduleInfo.java +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/domain/ScheduleInfo.java @@ -1,21 +1,21 @@ -package com.wypl.jpacalendardomain.schedule.domain; +package com.wypl.jpacalendardomain.calendar.domain; -import com.wypl.jpacalendardomain.calendar.domain.Calendar; +import com.wypl.jpacommon.JpaBaseEntity; import jakarta.persistence.*; -import lombok.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; import org.hibernate.annotations.SQLRestriction; import java.time.LocalDateTime; -@Builder @Getter -@AllArgsConstructor @NoArgsConstructor(access = AccessLevel.PROTECTED) @SQLRestriction("deleted_at is null") @Entity -@Table(name = "schedule_info") -public class ScheduleInfo { - // Todo : extends BaseEntity +@Table(name = "schedule_info_tbl") +public class ScheduleInfo extends JpaBaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -26,13 +26,12 @@ public class ScheduleInfo { @JoinColumn(name = "calendar_id", nullable = false) private Calendar calendar; - @Column(name = "start_datetime", nullable = false) - private LocalDateTime startDateTime; - - @Column(name = "end_datetime", nullable = false) - private LocalDateTime endDateTime; - @Column(name = "creator_id") private Long creatorId; + @Builder + public ScheduleInfo(Calendar calendar, LocalDateTime startDateTime, LocalDateTime endDateTime, Long creatorId) { + this.calendar = calendar; + this.creatorId = creatorId; + } } diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/mapper/ScheduleInfoMapper.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/mapper/ScheduleInfoMapper.java new file mode 100644 index 0000000..a123848 --- /dev/null +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/mapper/ScheduleInfoMapper.java @@ -0,0 +1,17 @@ +package com.wypl.jpacalendardomain.calendar.mapper; + + +import com.wypl.jpacalendardomain.calendar.data.ConvertibleScheduleInfo; +import com.wypl.jpacalendardomain.calendar.domain.Calendar; +import com.wypl.jpacalendardomain.calendar.domain.ScheduleInfo; + +public class ScheduleInfoMapper { + + public static ScheduleInfo toJpaScheduleInfo(ConvertibleScheduleInfo convertibleScheduleInfo, Calendar calendar) { + return ScheduleInfo.builder() + .creatorId(convertibleScheduleInfo.getCreatorId()) + .calendar(calendar) + .build(); + } + +} diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/mapper/ScheduleMapper.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/mapper/ScheduleMapper.java new file mode 100644 index 0000000..fc05a9d --- /dev/null +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/mapper/ScheduleMapper.java @@ -0,0 +1,23 @@ +package com.wypl.jpacalendardomain.calendar.mapper; + +import com.wypl.jpacalendardomain.calendar.data.ConvertibleSchedule; +import com.wypl.jpacalendardomain.calendar.domain.Schedule; +import com.wypl.jpacalendardomain.calendar.domain.ScheduleInfo; + +public class ScheduleMapper { + + public static Schedule toJpaSchedule(ConvertibleSchedule convertibleSchedule, ScheduleInfo scheduleInfo) { + return Schedule.builder() + .scheduleInfo(scheduleInfo) + .title(convertibleSchedule.getTitle()) + .description(convertibleSchedule.getDescription()) + .startDateTime(convertibleSchedule.getStartDateTime()) + .endDateTime(convertibleSchedule.getEndDateTime()) + .repetitionStartDate(convertibleSchedule.getRepetitionStartDate()) + .repetitionEndDate(convertibleSchedule.getRepetitionEndDate()) + .repetitionCycle(convertibleSchedule.getRepetitionCycle()) + .dayOfWeek(convertibleSchedule.getDayOfWeek()) + .weekInterval(convertibleSchedule.getWeekInterval()) + .build(); + } +} diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/repository/ScheduleInfoRepository.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/repository/ScheduleInfoRepository.java new file mode 100644 index 0000000..4564f7a --- /dev/null +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/repository/ScheduleInfoRepository.java @@ -0,0 +1,7 @@ +package com.wypl.jpacalendardomain.calendar.repository; + +import com.wypl.jpacalendardomain.calendar.domain.ScheduleInfo; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ScheduleInfoRepository extends JpaRepository { +} diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/repository/ScheduleRepository.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/repository/ScheduleRepository.java new file mode 100644 index 0000000..a6cd842 --- /dev/null +++ b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/calendar/repository/ScheduleRepository.java @@ -0,0 +1,7 @@ +package com.wypl.jpacalendardomain.calendar.repository; + +import com.wypl.jpacalendardomain.calendar.domain.Schedule; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface ScheduleRepository extends JpaRepository { +} diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/domain/Repetition.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/domain/Repetition.java deleted file mode 100644 index 8941de5..0000000 --- a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/domain/Repetition.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.wypl.jpacalendardomain.schedule.domain; - -import com.wypl.jpacalendardomain.schedule.data.RepetitionCycle; -import jakarta.persistence.*; -import lombok.*; -import org.hibernate.annotations.SQLRestriction; - -@Builder -@Getter -@AllArgsConstructor -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@SQLRestriction("deleted_at is null") -@Entity -@Table(name = "repetition") -public class Repetition { - // Todo : extends BaseEntity - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "repetition_id") - private Long repetitionId; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "schedule_info_id", nullable = false) - private ScheduleInfo scheduleInfo; - - @Enumerated(EnumType.STRING) - @Column(name = "repetition_cycle") - private RepetitionCycle repetitionCycle; - - @Column(name = "day_of_week") - private Integer dayOfWeek; // bit - - @Column(name = "week_of_month") - private Integer weekOfMonth; -} diff --git a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/domain/Schedule.java b/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/domain/Schedule.java deleted file mode 100644 index 36fede8..0000000 --- a/domain/jpa-calendar-domain/src/main/java/com/wypl/jpacalendardomain/schedule/domain/Schedule.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.wypl.jpacalendardomain.schedule.domain; - -import jakarta.persistence.*; -import lombok.*; -import org.hibernate.annotations.SQLRestriction; - -import java.time.LocalDateTime; - -@Builder -@Getter -@AllArgsConstructor -@NoArgsConstructor(access = AccessLevel.PROTECTED) -@SQLRestriction("deleted_at is null") -@Entity -@Table(name = "schedule") -public class Schedule { - // Todo : extends BaseEntity - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "schedule_id") - private Long scheduleId; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "schedule_info_id", nullable = false) - private ScheduleInfo scheduleInfo; - - @Column(name = "title", length = 100) - private String title; - - @Column(name = "description") - private String description; - - @Column(name = "start_datetime", nullable = false) - private LocalDateTime startDateTime; - - @Column(name = "end_datetime", nullable = false) - private LocalDateTime endDateTime; -} diff --git a/domain/jpa-common/src/main/java/com/wypl/jpacommon/JpaErrorCode.java b/domain/jpa-common/src/main/java/com/wypl/jpacommon/JpaErrorCode.java index e392a5d..170c78f 100644 --- a/domain/jpa-common/src/main/java/com/wypl/jpacommon/JpaErrorCode.java +++ b/domain/jpa-common/src/main/java/com/wypl/jpacommon/JpaErrorCode.java @@ -12,7 +12,7 @@ public enum JpaErrorCode implements ServerErrorCode { private final String errorCode; private final String message; - private JpaErrorCode(int statusCode, String errorCode, String message) { + JpaErrorCode(int statusCode, String errorCode, String message) { this.statusCode = statusCode; this.errorCode = errorCode; this.message = message; diff --git a/domain/mongo-common/src/main/java/com/wypl/mongocommon/MongoErrorCode.java b/domain/mongo-common/src/main/java/com/wypl/mongocommon/MongoErrorCode.java index d702cdb..53fadc8 100644 --- a/domain/mongo-common/src/main/java/com/wypl/mongocommon/MongoErrorCode.java +++ b/domain/mongo-common/src/main/java/com/wypl/mongocommon/MongoErrorCode.java @@ -12,7 +12,7 @@ public enum MongoErrorCode implements ServerErrorCode { private final String errorCode; private final String message; - private MongoErrorCode(int statusCode, String errorCode, String message) { + MongoErrorCode(int statusCode, String errorCode, String message) { this.statusCode = statusCode; this.errorCode = errorCode; this.message = message; diff --git a/settings.gradle b/settings.gradle index cfc7250..2ad2849 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,6 +15,7 @@ include ':domain:jpa-member-domain' include ':domain:jpamongo-review-domain' include ':domain:mongo-common' + /* Client Module */ include ':client' include ':client:aws-s3-client'