Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SuppressWarnings("deprecation")
- @PostMapping(path = "/checkLoginMobile")
- public ResponseEntity<UserAccountRespone> loginMobile(@RequestBody String account) throws ParseException {
- JSONParser parser = new JSONParser();
- JSONObject json = (JSONObject) parser.parse(account);
- String username = json.get("username").toString();
- String password = json.get("password").toString();
- UserAccount userAccount = userAccountRepository.login(username, password);
- UserProfile userProfile = userProfileRepository.getUserProfile(username);
- if (userAccount != null) {
- UserAccountRespone userAccountRespone = new UserAccountRespone(username, userProfile.getFullname(),
- userProfile.getBirth(), userProfile.getAddress(), userProfile.getCity(), userProfile.getEmail(),
- userProfile.getPhone(), userProfile.getSexual(), userProfile.getCreatedAt(),
- userProfile.getUpdatedAt(), userAccount.getRole().getId(), userAccount.getRole().getName());
- return new ResponseEntity<UserAccountRespone>(userAccountRespone, HttpStatus.OK);
- } else {
- return new ResponseEntity<UserAccountRespone>(new UserAccountRespone(), HttpStatus.OK);
- }
- }
- Resolved exception caused by Handler execution: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'ST' not supported
Add Comment
Please, Sign In to add comment