-
Notifications
You must be signed in to change notification settings - Fork 0
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 #49 from Central-MakeUs/dev
fix: 도메인 joincolum 수정
- Loading branch information
Showing
4 changed files
with
53 additions
and
71 deletions.
There are no files selected for viewing
24 changes: 10 additions & 14 deletions
24
core/core-domain/src/main/java/com/mm/coredomain/domain/Admin.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 |
---|---|---|
@@ -1,24 +1,20 @@ | ||
package com.mm.coredomain.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.*; | ||
|
||
@Entity | ||
public class Admin extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private String name; | ||
private String name; | ||
|
||
private String email; | ||
private String email; | ||
|
||
private String password; | ||
private String password; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Groups groups; | ||
@JoinColumn(name = "member_groups_id") | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Groups groups; | ||
} |
26 changes: 10 additions & 16 deletions
26
core/core-domain/src/main/java/com/mm/coredomain/domain/GroupPermission.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 |
---|---|---|
@@ -1,26 +1,20 @@ | ||
package com.mm.coredomain.domain; | ||
|
||
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.*; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@Entity | ||
public class GroupPermission extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@JoinColumn(name = "groups_id") | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Groups groups; | ||
@JoinColumn(name = "member_groups_id") | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Groups groups; | ||
|
||
@JoinColumn(name = "permission_id") | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Permission permission; | ||
@JoinColumn(name = "permission_id") | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Permission permission; | ||
} |
72 changes: 32 additions & 40 deletions
72
core/core-domain/src/main/java/com/mm/coredomain/domain/Member.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 |
---|---|---|
@@ -1,63 +1,55 @@ | ||
package com.mm.coredomain.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.ManyToOne; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Entity | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Member extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
private String name; | ||
private String name; | ||
|
||
private String email; | ||
private String email; | ||
|
||
@Builder.Default | ||
private Integer point = 0; | ||
@Builder.Default | ||
private Integer point = 0; | ||
|
||
private String depositorName; | ||
private String depositorName; | ||
|
||
private String account; | ||
private String account; | ||
|
||
private String accountBank; | ||
private String accountBank; | ||
|
||
@Builder.Default | ||
private MemberStatus memberStatus = MemberStatus.ACTIVE; | ||
@Builder.Default | ||
private MemberStatus memberStatus = MemberStatus.ACTIVE; | ||
|
||
private OAuthProvider provider; | ||
private OAuthProvider provider; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
private Groups groups; | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "member_groups_id") | ||
private Groups groups; | ||
|
||
public void updateMemberAccount(String depositorName, String account, String accountBank) { | ||
this.depositorName = depositorName; | ||
this.account = account; | ||
this.accountBank = accountBank; | ||
} | ||
public void updateMemberAccount(String depositorName, String account, String accountBank) { | ||
this.depositorName = depositorName; | ||
this.account = account; | ||
this.accountBank = accountBank; | ||
} | ||
|
||
public void updateMemberName(String name) { | ||
this.name = name; | ||
} | ||
public void updateMemberName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public void plusMemberPoint(Integer point) { | ||
this.point += point; | ||
} | ||
public void plusMemberPoint(Integer point) { | ||
this.point += point; | ||
} | ||
|
||
public void minusMemberPoint(Integer point) { | ||
this.point -= point; | ||
} | ||
public void minusMemberPoint(Integer point) { | ||
this.point -= point; | ||
} | ||
} |
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