Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value = "/getUserInfo", produces = "application/json", method = RequestMethod.GET)
- public ResponseEntity<UserModel> getUserInfo(@RequestParam(value = "data", required = true) String data) {
- HashMap<String, String> userData = JavaUtil.dissasambleJson(data);
- String username = userData.get("username");
- Optional<List<Long>> foundUserId = userRepo.getUserId(username);
- if (!foundUserId.isPresent()) {
- return new ResponseEntity<>(null, HttpStatus.OK);
- }
- UserModel userResult = userRepo.findById(foundUserId.get().get(0)).get();
- return new ResponseEntity<>(userResult, HttpStatus.OK);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement