Last change
on this file since 0c37625 was 3fc9e50, checked in by KostaFortumanov <kfortumanov@…>, 3 years ago |
prototip part1
|
-
Property mode
set to
100644
|
File size:
985 bytes
|
Line | |
---|
1 | package it.finki.charitable.services;
|
---|
2 |
|
---|
3 | import it.finki.charitable.entities.AppUser;
|
---|
4 | import it.finki.charitable.repository.ConfirmationTokenRepository;
|
---|
5 | import it.finki.charitable.security.ConfirmationToken;
|
---|
6 | import org.springframework.stereotype.Service;
|
---|
7 |
|
---|
8 | import java.util.List;
|
---|
9 |
|
---|
10 | @Service
|
---|
11 | public class ConfirmationTokenService {
|
---|
12 |
|
---|
13 | private final ConfirmationTokenRepository tokenRepository;
|
---|
14 |
|
---|
15 | public ConfirmationTokenService(ConfirmationTokenRepository tokenRepository) {
|
---|
16 | this.tokenRepository = tokenRepository;
|
---|
17 | }
|
---|
18 |
|
---|
19 | public ConfirmationToken getConfirmationToken(String token) {
|
---|
20 | return tokenRepository.findByToken(token).orElse(null);
|
---|
21 | }
|
---|
22 |
|
---|
23 | public List<ConfirmationToken> getAll() {
|
---|
24 | return tokenRepository.findAll();
|
---|
25 | }
|
---|
26 |
|
---|
27 | public void saveConfirmationToken(ConfirmationToken token) {
|
---|
28 | tokenRepository.save(token);
|
---|
29 | }
|
---|
30 |
|
---|
31 | public void deleteConfirmationToken(ConfirmationToken token) {
|
---|
32 | tokenRepository.delete(token);
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.