- Timestamp:
- 02/05/23 19:55:10 (21 months ago)
- Branches:
- master
- Children:
- 2b0a4db
- Parents:
- cc52b09
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/edu/gjoko/schedlr/services/StakeholderService.java
rcc52b09 ra436340 4 4 import edu.gjoko.schedlr.entity.StakeholderType; 5 5 import edu.gjoko.schedlr.repositories.StakeholderRepository; 6 import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 6 7 import org.springframework.stereotype.Service; 7 8 … … 10 11 11 12 private StakeholderRepository stakeholderRepository; 13 private BCryptPasswordEncoder bCryptPasswordEncoder; 12 14 13 public StakeholderService(StakeholderRepository stakeholderRepository) { 15 public StakeholderService(StakeholderRepository stakeholderRepository, 16 BCryptPasswordEncoder bCryptPasswordEncoder) { 14 17 this.stakeholderRepository = stakeholderRepository; 18 this.bCryptPasswordEncoder = bCryptPasswordEncoder; 15 19 } 16 20 17 21 public Stakeholder saveStakeholder(Stakeholder stakeholder) { 22 stakeholder.setPassword(bCryptPasswordEncoder.encode(stakeholder.getPassword())); 18 23 stakeholder.setStakeholderType(StakeholderType.CUSTOMER); 19 24 return stakeholderRepository.save(stakeholder);
Note:
See TracChangeset
for help on using the changeset viewer.