Skip to content

Commit

Permalink
feat : 회원가입 프로세스를 마치지 않은 경우에 사용될 Role Guest 구현 (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-ho committed Mar 8, 2024
1 parent 8ee03d5 commit a433d9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/java/gdsc/binaryho/imhere/core/member/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public class Member {
@CreatedDate
private LocalDateTime createdAt;

public static Member createGuestMember(String gitHubId, String gitHubHandle, String gitHubProfile) {
Member member = new Member();
member.gitHubResource = new GitHubResource(gitHubId, gitHubHandle, gitHubProfile);
member.setRole(Role.GUEST);
return member;
}

// TODO : OAUth2 도입 이후 사용하지 않을 기능
public static Member createMember(String univId, String name, String password, Role role) {
Member member = new Member();
member.setUnivId(univId);
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/gdsc/binaryho/imhere/core/member/Role.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package gdsc.binaryho.imhere.core.member;

public enum Role {
ADMIN("ROLE_ADMIN"), LECTURER("ROLE_LECTURER"), STUDENT("ROLE_STUDENT");
GUEST("ROLE_GUEST"),
ADMIN("ROLE_ADMIN"),
LECTURER("ROLE_LECTURER"),
STUDENT("ROLE_STUDENT"),

;

private final String key;

Expand Down

0 comments on commit a433d9a

Please sign in to comment.