-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feature/#100
- Loading branch information
Showing
5 changed files
with
56 additions
and
94 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/sumcoda/boardbuddy/config/InitializerConfig.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,22 @@ | ||
package sumcoda.boardbuddy.config; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.boot.ApplicationRunner; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import sumcoda.boardbuddy.service.MemberService; | ||
|
||
|
||
@Configuration | ||
@RequiredArgsConstructor | ||
public class InitializerConfig { | ||
|
||
private final MemberService memberService; | ||
|
||
@Bean | ||
public ApplicationRunner initializer() { | ||
return args -> { | ||
memberService.createAdminAccount(); | ||
}; | ||
} | ||
} |
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
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
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 |
---|---|---|
|
@@ -103,6 +103,35 @@ public void registerMember(MemberRequest.RegisterDTO registerDTO) { | |
} | ||
} | ||
|
||
/** | ||
* 애플리케이션 시작시 관리자 계정 생성 | ||
* | ||
**/ | ||
public void createAdminAccount() { | ||
memberRepository.save(Member.buildMember( | ||
"admin", | ||
bCryptPasswordEncoder.encode("a12345#"), | ||
"admin", | ||
"[email protected]", | ||
"01012345678", | ||
"서울 특별시", | ||
"강남구", | ||
"삼성동", | ||
2, | ||
50, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
0, | ||
null, | ||
null, | ||
MemberRole.USER, | ||
null) | ||
); | ||
} | ||
|
||
/** | ||
* 소셜 로그인 사용자에 대한 추가적인 회원가입 | ||
* | ||
|
This file was deleted.
Oops, something went wrong.