Advertisement
ADL_Rodrigo_Silva

Untitled

Nov 2nd, 2022
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. package cl.sii.springboot.app.seguridad.service;
  2.  
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Service;
  5.  
  6. import cl.sii.springboot.app.seguridad.modelo.User;
  7. import cl.sii.springboot.app.seguridad.repository.UserRepository;
  8.  
  9. @Service
  10. public class UserServiceImpl implements UserService {
  11.    
  12.     private UserRepository userRepository;
  13.    
  14.     @Autowired
  15.     public UserServiceImpl(UserRepository userRepository) {
  16.         this.userRepository = userRepository;
  17.     }
  18.  
  19.     @Override
  20.     public void saveUser(User user) {
  21.         userRepository.save(user);
  22.        
  23.     }
  24.  
  25.     @Override
  26.     public User getUserByNameAndPassWord(String name, String password) {
  27.        
  28.         User user = userRepository.findByUserNameAndPassword(name, password);
  29.        
  30.         return user;
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement