-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(Lightning): Lightning 객체 정의 * feat(Tag): Tag 객체 정의 * feat(TagType): TagType 객체 정의 * chore(Lightning): 최소 글자수 변경 * chore(Meeting): ImageURL 제약조건 추가 * chore(Lightning): 컬럼 이름 추가 * chore(Tag): @NotNull 제거 * chore(Tag): @entity 추가 * chore(Lightning): 기획수정으로 인한 엔티티 변경 * chore(Meeting): 최솟값 추가 * chore(Meeting): 이미지 최댓값 변경
- Loading branch information
Showing
5 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
main/src/main/java/org/sopt/makers/crew/main/entity/lightning/Lightning.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ImageUrlVO> imageURL; | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
main/src/main/java/org/sopt/makers/crew/main/entity/lightning/LightningPlaceType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.sopt.makers.crew.main.entity.lightning; | ||
|
||
public enum LightningPlaceType { | ||
OFFLINE, | ||
ONLINE, | ||
NOT_DECIDED | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
main/src/main/java/org/sopt/makers/crew/main/entity/tag/Tag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
main/src/main/java/org/sopt/makers/crew/main/entity/tag/TagType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.sopt.makers.crew.main.entity.tag; | ||
|
||
public enum TagType { | ||
MEETING, | ||
LIGHTING | ||
} |