diff --git a/src/main/java/com/readyvery/readyverydemo/domain/CeoInfo.java b/src/main/java/com/readyvery/readyverydemo/domain/CeoInfo.java index 10591e2..e6ddfa4 100644 --- a/src/main/java/com/readyvery/readyverydemo/domain/CeoInfo.java +++ b/src/main/java/com/readyvery/readyverydemo/domain/CeoInfo.java @@ -1,7 +1,10 @@ package com.readyvery.readyverydemo.domain; import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import jakarta.persistence.CascadeType; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.EnumType; @@ -12,6 +15,7 @@ import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; import jakarta.persistence.Table; import lombok.AllArgsConstructor; import lombok.Builder; @@ -37,29 +41,38 @@ public class CeoInfo extends BaseTimeEntity { @Column(nullable = false, length = 45) private String email; + // 비밀번호 + @Column(nullable = false, length = 100) + private String password; + // 닉네임 @Column(nullable = false) private String nickName; // 프로필 이미지 - @Column(nullable = false, columnDefinition = "TEXT") + @Column(nullable = true) private String imageUrl; // 전화번호 - @Column(nullable = false) + @Column private String phone; // 계좌번호 @Column private String accountNumber; + // 유저 권한 + @Column(nullable = false, columnDefinition = "VARCHAR(10) default 'USER'") + @Enumerated(EnumType.STRING) + private Role role; + // 소셜 로그인 타입 - @Column(nullable = false) + @Column @Enumerated(EnumType.STRING) private SocialType socialType; // KAKAO, NAVER, GOOGLE // 소셜 로그인 타입의 식별자 값 (일반 로그인인 경우 null) - @Column(nullable = false) + @Column private String socialId; // 로그인한 소셜 타입의 식별자 값 (일반 로그인인 경우 null) // 유저 상태 @@ -81,6 +94,11 @@ public class CeoInfo extends BaseTimeEntity { // 사장님 가게 연관관계 매핑 @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "store_idx") - private Store store; + private Store store = null; + + // 사장님 입점신청서 연관관계 매핑 + @Builder.Default + @OneToMany(mappedBy = "ceoInfo", cascade = CascadeType.ALL) + private List ceoMetaInfos = new ArrayList(); } diff --git a/src/main/java/com/readyvery/readyverydemo/domain/CeoMetaInfo.java b/src/main/java/com/readyvery/readyverydemo/domain/CeoMetaInfo.java new file mode 100644 index 0000000..e417aa6 --- /dev/null +++ b/src/main/java/com/readyvery/readyverydemo/domain/CeoMetaInfo.java @@ -0,0 +1,57 @@ +package com.readyvery.readyverydemo.domain; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +@Getter +@NoArgsConstructor +@Entity +@Builder +@Table(name = "INFOTAINMENT") +@AllArgsConstructor +@Slf4j +public class CeoMetaInfo extends BaseTimeEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "ceo_meta_idx") + private Long id; + + @Column(nullable = false, length = 45) + private String storeName; + + @Column(nullable = false, length = 100) + private String storeAddress; + + @Column(nullable = false, length = 45) + private String registrationNumber; + + @Column(nullable = false, columnDefinition = "TEXT") + private String businessLicenseFileName; + + @Column(nullable = false, columnDefinition = "TEXT") + private String businessReportFileName; + + @Column(nullable = false, columnDefinition = "TEXT") + private String identityCardFileName; + + @Column(nullable = false, columnDefinition = "TEXT") + private String bankAccountFileName; + + // 입점신청 사장님 연관관계 매핑 + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "ceo_idx") + private CeoInfo ceoInfo; + +}