-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from a-romantic-cat/feat/17
Feat/17
- Loading branch information
Showing
4 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
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,42 @@ | ||
package aromanticcat.umcproject.entity; | ||
|
||
import lombok.Getter; | ||
|
||
import javax.persistence.*; | ||
import java.time.LocalDateTime; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name = "letter") | ||
public class Letter extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long letter_id; | ||
|
||
@Column(name = "nickname", length = 60) | ||
private String nickname; | ||
|
||
@Column(length = 255) | ||
private String content; | ||
|
||
private Boolean open; | ||
|
||
@Column(name = "login_status") | ||
private Boolean loginStatus; | ||
|
||
@Column(name = "sender_ID") | ||
private Long senderId; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "letter_paper_id",insertable = false, updatable = false) | ||
private LetterPaper letterPaper; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "stamp_id", insertable = false, updatable = false) | ||
private Stamp stamp; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "id", insertable = false, updatable = false) | ||
private Letterbox letterbox; | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/aromanticcat/umcproject/entity/LetterPaper.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,26 @@ | ||
package aromanticcat.umcproject.entity; | ||
|
||
import lombok.Getter; | ||
|
||
import javax.persistence.*; | ||
import javax.validation.constraints.NotNull; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name = "letter_paper") | ||
public class LetterPaper extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long letter_paper_id; | ||
|
||
@NotNull | ||
private String image_url; | ||
|
||
@NotNull | ||
private String name; | ||
|
||
@OneToMany(mappedBy = "letterPaper") | ||
private List<Letter> letters; | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/aromanticcat/umcproject/entity/Letterbox.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,38 @@ | ||
package aromanticcat.umcproject.entity; | ||
|
||
import lombok.Getter; | ||
|
||
import javax.persistence.*; | ||
import javax.validation.constraints.NotNull; | ||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name = "letterbox") | ||
public class Letterbox extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long letterbox_id; | ||
|
||
@Column(name = "user_id", nullable = false) | ||
private Long userId; | ||
|
||
@NotNull | ||
private String name; | ||
@NotNull | ||
private String color; | ||
|
||
@NotNull | ||
@Column(name = "end_dt") | ||
private LocalDateTime endDt; | ||
|
||
@NotNull | ||
private Boolean activate; | ||
|
||
@NotNull | ||
private Boolean sender; | ||
|
||
@OneToMany(mappedBy = "letterbox") | ||
private List<Letter> letters; | ||
} |
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,26 @@ | ||
package aromanticcat.umcproject.entity; | ||
|
||
import lombok.Getter; | ||
|
||
import javax.persistence.*; | ||
import javax.validation.constraints.NotNull; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name = "stamp") | ||
public class Stamp extends BaseEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long stamp_id; | ||
|
||
@NotNull | ||
private String image_url; | ||
|
||
@NotNull | ||
private String name; | ||
|
||
@OneToMany(mappedBy = "stamp") | ||
private List<Letter> letters; | ||
} |