-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] 이동봉사자, 이동봉사 중개 Entity 분리 #15
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
feat: 이동봉사자, 이동봉사 중개 Entity 분리 (#13)
- Loading branch information
commit 436e75844e745b638f3cd8d965c8193496f86e93
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/main/java/com/pawwithu/connectdog/domain/intermediary/entity/Intermediary.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.pawwithu.connectdog.domain.intermediary.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
import org.springframework.security.crypto.password.PasswordEncoder; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
@Entity | ||
public class Intermediary { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
private String email; // 이메일 | ||
private String password; // 비밀번호 | ||
@Column(length = 20, nullable = false) | ||
private String name; // 중개자 이름/중개 단체명 | ||
@Column(columnDefinition = "TEXT") | ||
private String url; // 이동봉사 계정 링크 | ||
@Column(columnDefinition = "TEXT") | ||
private String authImage; // 인증 사진 | ||
@Enumerated(EnumType.STRING) | ||
private IntermediaryRole role; // 권한 | ||
private Boolean isOptionAgr; // 선택 이용약관 체크 여부 | ||
|
||
@Builder | ||
public Intermediary(String email, String password, String name, String url, String authImage, IntermediaryRole role, Boolean isOptionAgr) { | ||
this.email = email; | ||
this.password = password; | ||
this.name = name; | ||
this.url = url; | ||
this.authImage = authImage; | ||
this.role = role; | ||
this.isOptionAgr = isOptionAgr; | ||
} | ||
|
||
public void passwordEncode(PasswordEncoder passwordEncoder) { | ||
this.password = passwordEncoder.encode(this.password); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/pawwithu/connectdog/domain/intermediary/entity/IntermediaryRole.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.pawwithu.connectdog.domain.intermediary.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum IntermediaryRole { | ||
|
||
INTERMEDIARY("ROLE_INTERMEDIARY"), AUTH_INTERMEDIARY("ROLE_AUTH_INTERMEDIARY"); | ||
|
||
private final String key; | ||
} |
15 changes: 0 additions & 15 deletions
15
src/main/java/com/pawwithu/connectdog/domain/member/entity/Role.java
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
src/main/java/com/pawwithu/connectdog/domain/member/entity/SocialType.java
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/main/java/com/pawwithu/connectdog/domain/member/repository/MemberRepository.java
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
src/main/java/com/pawwithu/connectdog/domain/volunteer/entity/SocialType.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.pawwithu.connectdog.domain.volunteer.entity; | ||
|
||
public enum SocialType { | ||
KAKAO, NAVER | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/com/pawwithu/connectdog/domain/volunteer/entity/VolunteerRole.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.pawwithu.connectdog.domain.volunteer.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum VolunteerRole { | ||
|
||
USER("ROLE_USER"), AUTH_USER("ROLE_AUTH_USER"); | ||
|
||
private final String key; | ||
|
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
우와 columnDefinition에 대해서 처음 알았어요.
해당 컬럼이 데이터베이스에 어떻게 생성될 것인지를 직접 지정할 수 있는 어노테이션이고, "TEXT"는 대용량의 문자열을 저장할 수 있는 데이터 타입을 의미하는 것 맞나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
맞습니다! 근데 columnDefinition = "TEXT"는 String으로 지정했을 때 varchar(255) 제한을 해제하는 건데, 이미지 url에는 사용을 안 해도 될 것 같아서 지우는 게 좋을 것 같아요! (보통 게시판 글의 내용의 제한을 해제할 때 썼습니다!)
이름의 length는 20으로 지정해두고 다른 컬럼은 따로 지정 안 했는데, 이 부분은 자세한 정보까지 나오면 바꿀게요!