-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
30 deletions.
There are no files selected for viewing
58 changes: 29 additions & 29 deletions
58
src/main/java/bootcamp/wssrs/domain/Member/repository/DBInit.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,29 +1,29 @@ | ||
//package bootcamp.wssrs.domain.Member.repository; | ||
// | ||
//import bootcamp.wssrs.domain.Member.entity.Member; | ||
//import jakarta.annotation.PostConstruct; | ||
//import lombok.RequiredArgsConstructor; | ||
//import org.springframework.beans.factory.annotation.Value; | ||
//import org.springframework.security.crypto.password.PasswordEncoder; | ||
//import org.springframework.stereotype.Component; | ||
// | ||
//@Component | ||
//@RequiredArgsConstructor | ||
//public class DBInit { | ||
// | ||
// private final AuthRepository authRepository; | ||
// private final PasswordEncoder encoder; | ||
// | ||
// @Value("${admin.email}") | ||
// private String email; | ||
// | ||
// @Value("${admin.password}") | ||
// private String password; | ||
// | ||
// | ||
// @PostConstruct | ||
// private void postConstruct() { | ||
// Member admin = Member.createAdmin(email, password, encoder); | ||
// authRepository.save(admin); | ||
// } | ||
//} | ||
package bootcamp.wssrs.domain.Member.repository; | ||
|
||
import bootcamp.wssrs.domain.Member.entity.Member; | ||
import jakarta.annotation.PostConstruct; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.security.crypto.password.PasswordEncoder; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class DBInit { | ||
|
||
private final AuthRepository authRepository; | ||
private final PasswordEncoder encoder; | ||
|
||
@Value("${admin.email}") | ||
private String email; | ||
|
||
@Value("${admin.password}") | ||
private String password; | ||
|
||
|
||
@PostConstruct | ||
private void postConstruct() { | ||
Member admin = Member.createAdmin(email, password, encoder); | ||
authRepository.save(admin); | ||
} | ||
} |
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