source: src/main/java/it/finki/charitable/services/ConfirmationTokenService.java@ f8007b3

Last change on this file since f8007b3 was 3fc9e50, checked in by KostaFortumanov <kfortumanov@…>, 3 years ago

prototip part1

  • Property mode set to 100644
File size: 985 bytes
Line 
1package it.finki.charitable.services;
2
3import it.finki.charitable.entities.AppUser;
4import it.finki.charitable.repository.ConfirmationTokenRepository;
5import it.finki.charitable.security.ConfirmationToken;
6import org.springframework.stereotype.Service;
7
8import java.util.List;
9
10@Service
11public 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.