Advertisement
Guest User

Untitled

a guest
Nov 10th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1.     @PostMapping
  2.     public ResponseEntity<UserView> getUserByEmailAndPassword(@RequestBody User user) {
  3.         User findUser = userService.getUserByEmailAndPasswordDatabase(user.getEmail(), user.getPassword());
  4.         UserView view = UserView.fromEntity(findUser);
  5.         return new ResponseEntity<UserView>(view, HttpStatus.OK);
  6.     }
  7.  
  8.     public User getUserByEmailAndPasswordDatabase(String email, String password) {
  9.         return userMapper.getUserByEmailAndPassword(email, password);
  10.     }
  11.  
  12.  
  13.     @Select("SELECT * FROM users WHERE email=#{email} AND password=#{password}")
  14.     User getUserByEmailAndPassword(@Param("email") String email, @Param("password") String password);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement