Skip to content

Commit

Permalink
Merge pull request #49 from Central-MakeUs/dev
Browse files Browse the repository at this point in the history
fix: 도메인 joincolum 수정
  • Loading branch information
KarmaPol authored Feb 13, 2024
2 parents 7aa05ff + 72ed6e5 commit f0a1c96
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 71 deletions.
24 changes: 10 additions & 14 deletions core/core-domain/src/main/java/com/mm/coredomain/domain/Admin.java
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;
}
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 core/core-domain/src/main/java/com/mm/coredomain/domain/Member.java
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private RequestMatcher[] permitAllRequests() {
private RequestMatcher[] oauthRequests() {
List<RequestMatcher> requestMatchers = List.of(
antMatcher("/oauth2/authorization/*"),
antMatcher("/oauth/**"),
antMatcher("/oauth/*/*"),
antMatcher("/api/*/auth/refresh-access-token"),
antMatcher("/super-token")
);
Expand Down

0 comments on commit f0a1c96

Please sign in to comment.