diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/Lightning.java b/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/Lightning.java new file mode 100644 index 00000000..9d5e7801 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/Lightning.java @@ -0,0 +1,77 @@ +package org.sopt.makers.crew.main.entity.lightning; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.List; + +import org.hibernate.annotations.Type; +import org.sopt.makers.crew.main.entity.common.BaseTimeEntity; +import org.sopt.makers.crew.main.entity.meeting.vo.ImageUrlVO; + +import io.hypersistence.utils.hibernate.type.json.JsonBinaryType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Table(name = "lightning") +public class Lightning extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @NotNull + @Column(name = "leaderUserId") + private Integer leaderUserId; + + @NotNull + @Size(min = 1, max = 30) + @Column(name = "title") + private String title; + + @Column(name = "desc", columnDefinition = "TEXT") + private String desc; + + @Column(name = "activityStartDate") + @NotNull + private LocalDate activityStartDate; + + @Column(name = "activityEndDate") + @NotNull + private LocalDateTime activityEndDate; + + @Column(name = "lightningTime") + private LocalDateTime lightningTime; + + @Column(name = "lightningPlaceType") + @NotNull + @Enumerated(EnumType.STRING) + private LightningPlaceType lightningPlaceType; + + @Column(name = "lightningPlace") + @NotNull + private String lightningPlace; + + @Column(name = "minimumCapacity") + private int minimumCapacity; + + @Column(name = "maximumCapacity") + private int maximumCapacity; + + @Column(name = "imageURL", columnDefinition = "jsonb") + @Type(JsonBinaryType.class) + private List imageURL; + +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/LightningPlaceType.java b/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/LightningPlaceType.java new file mode 100644 index 00000000..91550d43 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/lightning/LightningPlaceType.java @@ -0,0 +1,7 @@ +package org.sopt.makers.crew.main.entity.lightning; + +public enum LightningPlaceType { + OFFLINE, + ONLINE, + NOT_DECIDED +} 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 98e3cf81..d358d0f3 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 @@ -20,6 +20,7 @@ import java.time.LocalDateTime; import java.util.List; +import jakarta.validation.constraints.Size; import lombok.AccessLevel; import lombok.Builder; import lombok.Getter; @@ -78,6 +79,7 @@ public class Meeting extends BaseTimeEntity { */ @Column(name = "imageURL", columnDefinition = "jsonb") @Type(JsonBinaryType.class) + @Size(min = 1, max = 6) private List imageURL; /** diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/tag/Tag.java b/main/src/main/java/org/sopt/makers/crew/main/entity/tag/Tag.java new file mode 100644 index 00000000..aed520cf --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/tag/Tag.java @@ -0,0 +1,47 @@ +package org.sopt.makers.crew.main.entity.tag; + +import org.sopt.makers.crew.main.entity.common.BaseTimeEntity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@Table(name = "tag") +public class Tag extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + /** + * @implSpec : 모임태그 or 번쩍태그 구분 + * @implNote : 모임태그일 경우, lightningId == null + * @implNote : 번쩍태그일 경우, meetingId == null + * */ + @Enumerated(EnumType.STRING) + @Column(name = "tagType") + @NotNull + private TagType tagType; + + @Column(name = "meetingId") + private Integer meetingId; + + @Column(name = "lightningId") + private Integer lightningId; + + @NotNull + private String content; + +} diff --git a/main/src/main/java/org/sopt/makers/crew/main/entity/tag/TagType.java b/main/src/main/java/org/sopt/makers/crew/main/entity/tag/TagType.java new file mode 100644 index 00000000..2c7c17b1 --- /dev/null +++ b/main/src/main/java/org/sopt/makers/crew/main/entity/tag/TagType.java @@ -0,0 +1,6 @@ +package org.sopt.makers.crew.main.entity.tag; + +public enum TagType { + MEETING, + LIGHTING +}