Guest User

Untitled

a guest
Mar 4th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. @SuppressWarnings("deprecation")
  2. @PostMapping(path = "/checkLoginMobile")
  3. public ResponseEntity<UserAccountRespone> loginMobile(@RequestBody String account) throws ParseException {
  4.  
  5. JSONParser parser = new JSONParser();
  6.  
  7. JSONObject json = (JSONObject) parser.parse(account);
  8. String username = json.get("username").toString();
  9. String password = json.get("password").toString();
  10. UserAccount userAccount = userAccountRepository.login(username, password);
  11. UserProfile userProfile = userProfileRepository.getUserProfile(username);
  12.  
  13. if (userAccount != null) {
  14. UserAccountRespone userAccountRespone = new UserAccountRespone(username, userProfile.getFullname(),
  15. userProfile.getBirth(), userProfile.getAddress(), userProfile.getCity(), userProfile.getEmail(),
  16. userProfile.getPhone(), userProfile.getSexual(), userProfile.getCreatedAt(),
  17. userProfile.getUpdatedAt(), userAccount.getRole().getId(), userAccount.getRole().getName());
  18.  
  19. return new ResponseEntity<UserAccountRespone>(userAccountRespone, HttpStatus.OK);
  20. } else {
  21. return new ResponseEntity<UserAccountRespone>(new UserAccountRespone(), HttpStatus.OK);
  22. }
  23. }
  24.  
  25. Resolved exception caused by Handler execution: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'ST' not supported
Add Comment
Please, Sign In to add comment