Skip to content

Commit

Permalink
Fix: CeoMetaInfo Entity 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
1223v committed Mar 23, 2024
1 parent 4300c38 commit a03a392
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 5 deletions.
28 changes: 23 additions & 5 deletions src/main/java/com/readyvery/readyverydemo/domain/CeoInfo.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -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)

// 유저 상태
Expand All @@ -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<CeoMetaInfo> ceoMetaInfos = new ArrayList<CeoMetaInfo>();

}
57 changes: 57 additions & 0 deletions src/main/java/com/readyvery/readyverydemo/domain/CeoMetaInfo.java
Original file line number Diff line number Diff line change
@@ -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;

}

0 comments on commit a03a392

Please sign in to comment.