Last change
on this file since c45b67b was 9dd526f, checked in by andrejTavchioski <andrej.tavchioski@…>, 2 years ago |
backend refactoring
|
-
Property mode
set to
100644
|
File size:
1021 bytes
|
Rev | Line | |
---|
[ce6ad22] | 1 | package parkup.configs.token;
|
---|
| 2 |
|
---|
| 3 | import org.springframework.stereotype.Service;
|
---|
| 4 |
|
---|
| 5 | import java.time.LocalDateTime;
|
---|
| 6 | import java.util.Optional;
|
---|
| 7 |
|
---|
| 8 | @Service
|
---|
| 9 | public class ConfirmationTokenService {
|
---|
| 10 |
|
---|
[97fbc67] | 11 | private final ConfirmationTokenRepositoryRP confirmationTokenRepositoryRP;
|
---|
[ce6ad22] | 12 |
|
---|
[9ff45d6] | 13 |
|
---|
[9dd526f] | 14 | public ConfirmationTokenService(ConfirmationTokenRepositoryRP confirmationTokenRepositoryRP) {
|
---|
[97fbc67] | 15 | this.confirmationTokenRepositoryRP = confirmationTokenRepositoryRP;
|
---|
[ce6ad22] | 16 | }
|
---|
[97fbc67] | 17 | public void saveConfirmationTokenRP(ConfirmationTokenRP token){
|
---|
| 18 | confirmationTokenRepositoryRP.save(token);
|
---|
[ce6ad22] | 19 | }
|
---|
| 20 |
|
---|
[97fbc67] | 21 |
|
---|
| 22 | public Optional<ConfirmationTokenRP> getTokenRP(String token) {
|
---|
| 23 | return confirmationTokenRepositoryRP.findByToken(token);
|
---|
| 24 | }
|
---|
[ce6ad22] | 25 |
|
---|
[9dd526f] | 26 | public void deleteByRegisteredUser_RegParkId(int regParkId){
|
---|
| 27 | confirmationTokenRepositoryRP.deleteByRegisteredUser_RegParkId(regParkId);
|
---|
[97fbc67] | 28 | }
|
---|
| 29 |
|
---|
| 30 | public int setConfirmedAtRP(String token) {
|
---|
| 31 | return confirmationTokenRepositoryRP.updateConfirmedAt(token, LocalDateTime.now());
|
---|
| 32 | }
|
---|
[ce6ad22] | 33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.