diff --git a/src/main/java/aromanticcat/umcproject/entity/Member.java b/src/main/java/aromanticcat/umcproject/entity/Member.java index 30dba2d..5fa3b1b 100644 --- a/src/main/java/aromanticcat/umcproject/entity/Member.java +++ b/src/main/java/aromanticcat/umcproject/entity/Member.java @@ -1,18 +1,17 @@ package aromanticcat.umcproject.entity; +import lombok.*; + +import javax.persistence.*; import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import lombok.Getter; @Entity @Getter +@Builder +@AllArgsConstructor +@NoArgsConstructor +@ToString public class Member extends BaseEntity { @Id diff --git a/src/main/java/aromanticcat/umcproject/entity/NangmanLetter.java b/src/main/java/aromanticcat/umcproject/entity/NangmanLetter.java index d1cebe5..4a9325c 100644 --- a/src/main/java/aromanticcat/umcproject/entity/NangmanLetter.java +++ b/src/main/java/aromanticcat/umcproject/entity/NangmanLetter.java @@ -1,41 +1,46 @@ package aromanticcat.umcproject.entity; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import lombok.Getter; +import lombok.*; + +import javax.persistence.*; +import javax.validation.constraints.NotNull; @Entity @Getter +@Builder +@AllArgsConstructor +@NoArgsConstructor +@ToString public class NangmanLetter extends BaseEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; + @NotNull private String sender_nickname; - private boolean is_public; + @NotNull + private Boolean is_public; + @NotNull private String content; - private boolean has_response; + @NotNull + @Builder.Default + private Boolean has_response = false; - private int thumbs_up_cnt; + private Integer thumbs_up_cnt; - private int heart_cnt; + private Integer heart_cnt; - private int crying_cnt; + private Integer crying_cnt; - private int clover_cnt; + private Integer clover_cnt; - private int clap_cnt; + private Integer clap_cnt; - private int star_cnt; + private Integer star_cnt; @JoinColumn(name = "member_id") @ManyToOne(fetch = FetchType.LAZY)