From 6f1584bbc9563c185ef87b38703de2f62b8b2a69 Mon Sep 17 00:00:00 2001 From: HiSeungmin Date: Fri, 3 Jan 2025 16:56:15 +0900 Subject: [PATCH 1/6] =?UTF-8?q?Feat:=20=ED=9A=8C=EC=9B=90=20Entity=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 회원 관련 엔티티 생성, 수정, 삭제 메서드 추가 - Cascade 설정 (부모 엔티티 제거 시, 자식 엔티티 제거) - Orphan 설정 (고아 객체 제거) close: #32 --- .../devlens/domain/member/entity/Company.java | 51 +++++++++++++++++++ .../domain/member/entity/Department.java | 37 ++++++++++++++ .../devlens/domain/member/entity/Member.java | 9 ++-- .../entity/MemberPasswordResetHistory.java | 13 +++++ .../member/entity/MemberProfileHistory.java | 21 ++++++++ .../domain/member/entity/Position.java | 20 ++++++++ .../devlens/domain/member/entity/Term.java | 15 ++++++ .../member/entity/TermsAgreementHistory.java | 25 ++++++--- 8 files changed, 180 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/Company.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/Company.java index 5d48e1d0..ce508fb1 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/Company.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/Company.java @@ -6,6 +6,9 @@ import jakarta.persistence.*; import lombok.*; +import java.util.ArrayList; +import java.util.List; + @Entity @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @@ -20,6 +23,9 @@ public class Company extends BaseEntity { @Column(name = "company_name", nullable = false, length = 255) private String companyName; // 회사명 + @OneToMany(mappedBy = "company", cascade = CascadeType.ALL, orphanRemoval = true) + private List departments = new ArrayList<>(); // 부서 리스트 + @Column(name = "representative_name", nullable = false, length = 100) private String representativeName; // 대표자명 @@ -46,4 +52,49 @@ public class Company extends BaseEntity { @Column(name = "is_active", nullable = false) @Enumerated(EnumType.STRING) private YN isActive = YN.Y; // 사용 여부 + + + // 생성 메서드 + public static Company createCompany( String companyName, String representativeName, String representativeContact, String representativeEmail, + String address, BusinessType businessType, String businessRegistrationNumber, YN representativeImageExists) + { + Company company = new Company(); + company.address = address; + company.companyName = companyName; + company.businessType = businessType; + company.representativeName = representativeName; + company.representativeEmail = representativeEmail; + company.representativeContact = representativeContact; + company.businessRegistrationNumber = businessRegistrationNumber; + company.representativeImageExists = representativeImageExists != null ? representativeImageExists : YN.N; + return company; + } + + // 수정 메서드 + public void updateCompany(String representativeName, String representativeContact, String representativeEmail, + String address, YN representativeImageExists) { + this.address = address; + this.representativeName = representativeName; + this.representativeEmail = representativeEmail; + this.representativeContact = representativeContact; + this.representativeImageExists = representativeImageExists; + + } + + // 삭제 메서드 + public void deleteCompany() { + this.isActive = YN.N; + } + + // 부서 추가 메서드 + public void addDepartment(Department department) { + this.departments.add(department); + department.setCompany(this); + } + + // 부서 삭제 메서드 + public void removeDepartment(Department department) { + this.departments.remove(department); + department.setCompany(null); + } } \ No newline at end of file diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/Department.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/Department.java index 0cc02c21..c134b372 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/Department.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/Department.java @@ -5,6 +5,9 @@ import jakarta.persistence.*; import lombok.*; +import java.util.ArrayList; +import java.util.List; + @Entity @Getter @NoArgsConstructor(access = AccessLevel.PROTECTED) @@ -20,6 +23,9 @@ public class Department extends BaseEntity { @JoinColumn(name = "company_id", nullable = false, referencedColumnName = "id") private Company company; + @OneToMany(mappedBy = "department", cascade = CascadeType.ALL, orphanRemoval = true) + private List positions = new ArrayList<>(); // 부서에 속한 직책 리스트 + @Column(name = "department_name", nullable = false, length = 50) private String departmentName; @@ -29,4 +35,35 @@ public class Department extends BaseEntity { @Column(name = "is_active", nullable = false) @Enumerated(EnumType.STRING) private YN isActive = YN.Y; + + // 생성 메서드 + public static Department createDepartment(Company company, String departmentName, String description) { + Department department = new Department(); + department.company = company; + department.description = description; + department.departmentName = departmentName; + return department; + } + + // 회사 설정 메서드 + public void setCompany(Company company) { + this.company = company; + } + + // 직책 추가 메서드 + public void addPosition(Position position) { + this.positions.add(position); + position.setDepartment(this); + } + + // 직책 삭제 메서드 + public void removePosition(Position position) { + this.positions.remove(position); + position.setDepartment(null); + } + + // 삭제 메서드 + public void deleteDepartment() { + this.isActive = YN.N; + } } diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/Member.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/Member.java index 15a325e1..c45065d0 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/Member.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/Member.java @@ -62,9 +62,8 @@ public class Member extends BaseEntity { // 생성 메서드 - public static Member createMember(String loginId, String password, Company companyId, Role role, - YN profileImageExists, String name, String email, LocalDate birthDate, - String phoneNumber, Long departmentId, Long positionId) { + public static Member createMember(String loginId, String password, Company companyId, Role role, String name, String email, + LocalDate birthDate, String phoneNumber, Long departmentId, Long positionId) { Member member = new Member(); member.name = name; member.role = role; @@ -76,17 +75,17 @@ public static Member createMember(String loginId, String password, Company compa member.phoneNumber = phoneNumber; member.positionId = positionId; member.departmentId = departmentId; - member.profileImageExists = profileImageExists; return member; } // 업데이트 메서드 - public void updateMember(String password, String phoneNumber, Company company, Long departmentId, Long positionId) { + public void updateMember(String password, String phoneNumber, Company company, Long departmentId, Long positionId, YN profileImageExists) { this.company = company; this.password = password; this.phoneNumber = phoneNumber; this.departmentId = departmentId; this.positionId = positionId; + this.profileImageExists = profileImageExists; } // 삭제 메서드 diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberPasswordResetHistory.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberPasswordResetHistory.java index 31acfb69..df64b537 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberPasswordResetHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberPasswordResetHistory.java @@ -31,4 +31,17 @@ public class MemberPasswordResetHistory extends BaseEntity { @Column(name = "change_ip", nullable = false, length = 50) private String changeIp; // 변경 IP + + + // 생성 메서드 + public static MemberPasswordResetHistory createPwdHistory( Long memberId, String password, String changer, String changeIp ) { + MemberPasswordResetHistory history = new MemberPasswordResetHistory(); + history.memberId = memberId; + history.password = password; + history.changer = changer; + history.changeIp = changeIp; + history.changeDate = LocalDateTime.now(); + return history; + } + } \ No newline at end of file diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java index e1332414..5d57b12f 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java @@ -51,4 +51,25 @@ public class MemberProfileHistory extends BaseEntity { @Column(name = "position", length = 100) private String position; // 직책 + + + + public static MemberProfileHistory createProfileHistory( Long memberId, String memberEmail, Long companyId, Role role, String name, String email, + LocalDate birthDate, String phoneNumber, Boolean profileImageExists, String department, String position ) { + MemberProfileHistory history = new MemberProfileHistory(); + history.memberId = memberId; + history.memberEmail = memberEmail; + history.companyId = companyId; + history.role = role; + history.name = name; + history.email = email; + history.birthDate = birthDate; + history.phoneNumber = phoneNumber; + history.department = department; + history.position = position; + history.profileImageExists = profileImageExists != null ? profileImageExists : false; + return history; + } + + } \ No newline at end of file diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/Position.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/Position.java index 8cd98988..1d90ac3f 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/Position.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/Position.java @@ -30,4 +30,24 @@ public class Position extends BaseEntity { @Enumerated(EnumType.STRING) private YN isActive = YN.Y; + + // 생성 메서드 + public static Position createPosition( Department department, String positionName, String description) { + Position position = new Position(); + position.department = department; + position.description = description; + position.positionName = positionName; + return position; + } + + // 부서 설정 메서드 + public void setDepartment(Department department) { + this.department = department; + } + + // 삭제 메서드 + public void deletePostion() { + this.isActive = YN.N; + } + } diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java index f2881a91..328504ce 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java @@ -25,4 +25,19 @@ public class Term extends BaseEntity { @Column(name = "is_required", nullable = false) @Enumerated(EnumType.STRING) private YN isRequired; // 필수 여부 + + + // 생성 메서드 + public static Term createTerm(String title, String content, YN isRequired) { + Term term = new Term(); + term.title = title; + term.content = content; + term.isRequired = isRequired != null? isRequired : YN.N; + return term; + } + + // 삭제 메서드 + public void delete() { + + } } \ No newline at end of file diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java index 469f2fce..1a3b2ae8 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java @@ -20,17 +20,30 @@ public class TermsAgreementHistory extends BaseEntity { @Column(name = "term_id") private Long termId; // 약관 이력 ID - @Column(name = "terms_title", nullable = false) - private Long termsTitle; // 약관 항목 + @Column(name = "term_title", nullable = false) + private Long termTitle; // 약관 항목 - @Column(name = "member_email", nullable = false) - private Long memberEmail; // 회원 ID + @Column(name = "member_id", nullable = false) + private Long memberId; // 회원 ID - @Column(name = "agreement_status", nullable = false) + @Column(name = "is_agree", nullable = false) @Enumerated(EnumType.STRING) - private YN agreementStatus; // 약관 동의 여부 + private YN is_agree; // 약관 동의 여부 @Column(name = "status", length = 50) @Enumerated(EnumType.STRING) private TermsStatus status; // 상태 + + + // 생성 메서드 + public static TermsAgreementHistory createTermsAgreementHistory( Long termId, Long termTitle, Long memberId, YN is_agree, TermsStatus status) { + TermsAgreementHistory termsAgreeHistory = new TermsAgreementHistory(); + termsAgreeHistory.termId = termId; + termsAgreeHistory.termTitle = termTitle; + termsAgreeHistory.memberId = memberId; + termsAgreeHistory.is_agree = is_agree; + termsAgreeHistory.status = status; + return termsAgreeHistory; + } + } \ No newline at end of file From 3f5d28bf771892ab4617f9dd5eda62c078d2f39c Mon Sep 17 00:00:00 2001 From: HiSeungmin Date: Sun, 5 Jan 2025 14:28:50 +0900 Subject: [PATCH 2/6] =?UTF-8?q?Chore:=20=EC=95=BD=EA=B4=80=20=EC=9D=B4?= =?UTF-8?q?=EB=A0=A5=20=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 약관 동의 이력 테이블 상태 컬럼 제거 - 약관 이력 테이블 상태 컬럼, 상태 변경 메서드 추가 close: #32 --- .../devlens/domain/member/entity/Term.java | 18 ++++++++++++++---- .../member/entity/TermsAgreementHistory.java | 7 +------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java index 328504ce..d6fdddde 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java @@ -1,9 +1,11 @@ package com.seveneleven.devlens.domain.member.entity; +import com.seveneleven.devlens.domain.member.constant.TermsStatus; import com.seveneleven.devlens.domain.member.constant.YN; import com.seveneleven.devlens.global.entity.BaseEntity; import jakarta.persistence.*; import lombok.*; +import org.joda.time.DateTime; @Entity @Getter @@ -26,18 +28,26 @@ public class Term extends BaseEntity { @Enumerated(EnumType.STRING) private YN isRequired; // 필수 여부 + @Column(name = "expiration_date") + private DateTime expiration_date; // 만료 일자 + + @Column(name = "status", length = 50) + @Enumerated(EnumType.STRING) + private TermsStatus status; // 상태 + // 생성 메서드 - public static Term createTerm(String title, String content, YN isRequired) { + public static Term createTerm(String title, String content, YN isRequired, TermsStatus status) { Term term = new Term(); term.title = title; term.content = content; term.isRequired = isRequired != null? isRequired : YN.N; + term.status = status; return term; } - // 삭제 메서드 - public void delete() { - + // 상태 변경 메서드 + public void updateStatus(TermsStatus status) { + this.status = status; } } \ No newline at end of file diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java index 1a3b2ae8..dbc93f7b 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java @@ -30,19 +30,14 @@ public class TermsAgreementHistory extends BaseEntity { @Enumerated(EnumType.STRING) private YN is_agree; // 약관 동의 여부 - @Column(name = "status", length = 50) - @Enumerated(EnumType.STRING) - private TermsStatus status; // 상태 - // 생성 메서드 - public static TermsAgreementHistory createTermsAgreementHistory( Long termId, Long termTitle, Long memberId, YN is_agree, TermsStatus status) { + public static TermsAgreementHistory createTermsAgreementHistory( Long termId, Long termTitle, Long memberId, YN is_agree) { TermsAgreementHistory termsAgreeHistory = new TermsAgreementHistory(); termsAgreeHistory.termId = termId; termsAgreeHistory.termTitle = termTitle; termsAgreeHistory.memberId = memberId; termsAgreeHistory.is_agree = is_agree; - termsAgreeHistory.status = status; return termsAgreeHistory; } From 9aff96ab30c3211b4e17976ed07290c51c785206 Mon Sep 17 00:00:00 2001 From: HiSeungmin Date: Sun, 5 Jan 2025 14:43:28 +0900 Subject: [PATCH 3/6] =?UTF-8?q?Chore:=20=ED=9A=8C=EC=9B=90=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=ED=95=84=20=EC=9D=B4=EB=A0=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 회원 프로필 이력 생성 메서드 매개변수 엔티티로 수정 close: #32 --- .../member/entity/MemberProfileHistory.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java index 5d57b12f..72944266 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java @@ -1,6 +1,7 @@ package com.seveneleven.devlens.domain.member.entity; import com.seveneleven.devlens.domain.member.constant.Role; +import com.seveneleven.devlens.domain.member.constant.YN; import com.seveneleven.devlens.global.entity.BaseEntity; import jakarta.persistence.*; import lombok.*; @@ -44,7 +45,7 @@ public class MemberProfileHistory extends BaseEntity { private String phoneNumber; // 전화번호 @Column(name = "profile_image_exists", nullable = false) - private Boolean profileImageExists; // 프로필 이미지 유무 + private YN profileImageExists; // 프로필 이미지 유무 @Column(name = "department", length = 100) private String department; // 부서명 @@ -54,20 +55,19 @@ public class MemberProfileHistory extends BaseEntity { - public static MemberProfileHistory createProfileHistory( Long memberId, String memberEmail, Long companyId, Role role, String name, String email, - LocalDate birthDate, String phoneNumber, Boolean profileImageExists, String department, String position ) { + public static MemberProfileHistory createProfileHistory(Member member, String department, String position) { MemberProfileHistory history = new MemberProfileHistory(); - history.memberId = memberId; - history.memberEmail = memberEmail; - history.companyId = companyId; - history.role = role; - history.name = name; - history.email = email; - history.birthDate = birthDate; - history.phoneNumber = phoneNumber; + history.memberId = member.getId(); + history.memberEmail = member.getEmail(); + history.companyId = member.getCompany().getId(); + history.role = member.getRole(); + history.name = member.getName(); + history.email = member.getEmail(); + history.birthDate = member.getBirthDate(); + history.phoneNumber = member.getPhoneNumber(); history.department = department; history.position = position; - history.profileImageExists = profileImageExists != null ? profileImageExists : false; + history.profileImageExists = member.getProfileImageExists(); return history; } From b7a546db251cb919fdfc738238e297fac8c80447 Mon Sep 17 00:00:00 2001 From: HiSeungmin Date: Sun, 5 Jan 2025 14:44:31 +0900 Subject: [PATCH 4/6] =?UTF-8?q?Chore:=20=EC=95=BD=EA=B4=80=20=EC=9D=B4?= =?UTF-8?q?=EB=A0=A5=20=EC=97=94=ED=8B=B0=ED=8B=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 약관 엔티티 약관 항목 필드 반환타입 수정 close: #32 --- .../com/seveneleven/devlens/domain/member/entity/Term.java | 4 ++-- .../devlens/domain/member/entity/TermsAgreementHistory.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java index d6fdddde..253a3bee 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/Term.java @@ -26,7 +26,7 @@ public class Term extends BaseEntity { @Column(name = "is_required", nullable = false) @Enumerated(EnumType.STRING) - private YN isRequired; // 필수 여부 + private YN isRequired = YN.N; // 필수 여부 @Column(name = "expiration_date") private DateTime expiration_date; // 만료 일자 @@ -41,7 +41,7 @@ public static Term createTerm(String title, String content, YN isRequired, Terms Term term = new Term(); term.title = title; term.content = content; - term.isRequired = isRequired != null? isRequired : YN.N; + term.isRequired = isRequired; term.status = status; return term; } diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java index dbc93f7b..65aeead4 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/TermsAgreementHistory.java @@ -21,7 +21,7 @@ public class TermsAgreementHistory extends BaseEntity { private Long termId; // 약관 이력 ID @Column(name = "term_title", nullable = false) - private Long termTitle; // 약관 항목 + private String termTitle; // 약관 항목 @Column(name = "member_id", nullable = false) private Long memberId; // 회원 ID @@ -32,7 +32,7 @@ public class TermsAgreementHistory extends BaseEntity { // 생성 메서드 - public static TermsAgreementHistory createTermsAgreementHistory( Long termId, Long termTitle, Long memberId, YN is_agree) { + public static TermsAgreementHistory createTermsAgreementHistory( Long termId, String termTitle, Long memberId, YN is_agree) { TermsAgreementHistory termsAgreeHistory = new TermsAgreementHistory(); termsAgreeHistory.termId = termId; termsAgreeHistory.termTitle = termTitle; From 168c26d6e7e258417d7128f89f04de89da2e0f35 Mon Sep 17 00:00:00 2001 From: HiSeungmin Date: Sun, 5 Jan 2025 15:58:36 +0900 Subject: [PATCH 5/6] =?UTF-8?q?Chore:=20=EC=9D=B4=EB=A0=A5=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=EB=B8=94=20=EC=BB=AC=EB=9F=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 비밀번호 변경 이력 테이블 컬럼명 수정 - 프로필 이력 테이블 enum 어노테이션 추가 close: #32 --- .../entity/MemberPasswordResetHistory.java | 20 +++++++++---------- .../member/entity/MemberProfileHistory.java | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberPasswordResetHistory.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberPasswordResetHistory.java index df64b537..e53a65c0 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberPasswordResetHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberPasswordResetHistory.java @@ -23,24 +23,24 @@ public class MemberPasswordResetHistory extends BaseEntity { @Column(name = "password", nullable = false, length = 100) private String password; // 비밀번호 - @Column(name = "change_date", nullable = false) - private LocalDateTime changeDate; // 변경일시 + @Column(name = "changed_date", nullable = false) + private LocalDateTime changedDate; // 변경일시 @Column(name = "changer", nullable = false, length = 100) private String changer; // 변경자 - @Column(name = "change_ip", nullable = false, length = 50) - private String changeIp; // 변경 IP + @Column(name = "changed_ip", nullable = false, length = 50) + private String changedIp; // 변경 IP // 생성 메서드 - public static MemberPasswordResetHistory createPwdHistory( Long memberId, String password, String changer, String changeIp ) { + public static MemberPasswordResetHistory createPwdHistory( Long memberId, String password, String changer, String changedIp ) { MemberPasswordResetHistory history = new MemberPasswordResetHistory(); - history.memberId = memberId; - history.password = password; - history.changer = changer; - history.changeIp = changeIp; - history.changeDate = LocalDateTime.now(); + history.memberId = memberId; + history.password = password; + history.changer = changer; + history.changedIp = changedIp; + history.changedDate = LocalDateTime.now(); return history; } diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java index 72944266..6bdc4eaf 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java @@ -45,6 +45,7 @@ public class MemberProfileHistory extends BaseEntity { private String phoneNumber; // 전화번호 @Column(name = "profile_image_exists", nullable = false) + @Enumerated(EnumType.STRING) private YN profileImageExists; // 프로필 이미지 유무 @Column(name = "department", length = 100) From 82f0f7d6e44ba32047b2e9690a2bb45fc24f9dc6 Mon Sep 17 00:00:00 2001 From: HiSeungmin Date: Sun, 5 Jan 2025 16:01:31 +0900 Subject: [PATCH 6/6] =?UTF-8?q?Chore:=20=ED=9A=8C=EC=9B=90=20=EC=97=94?= =?UTF-8?q?=ED=8B=B0=ED=8B=B0=20=EC=BB=AC=EB=9F=BC=EB=AA=85=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Member, Member 프로필 이력 엔티티 생년월일 컬럼명 수정 close: #32 --- .../com/seveneleven/devlens/domain/member/entity/Member.java | 2 +- .../devlens/domain/member/entity/MemberProfileHistory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/Member.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/Member.java index c45065d0..d514c2ac 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/Member.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/Member.java @@ -48,7 +48,7 @@ public class Member extends BaseEntity { @Column(name = "email", nullable = false, length = 100) private String email; // 이메일 - @Column(name = "birth_date") + @Column(name = "date_of_birth") private LocalDate birthDate; // 생년월일 @Column(name = "phone_number", length = 20) diff --git a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java index 6bdc4eaf..cd8b27b0 100644 --- a/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java +++ b/src/main/java/com/seveneleven/devlens/domain/member/entity/MemberProfileHistory.java @@ -38,7 +38,7 @@ public class MemberProfileHistory extends BaseEntity { @Column(name = "email", nullable = false, length = 100) private String email; // 이메일 - @Column(name = "birth_date") + @Column(name = "date_of_birth") private LocalDate birthDate; // 생년월일 @Column(name = "phone_number", length = 20)