Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @GetMapping("/user/verification")
- @Secured({"ADMIN, USER"})
- public String getViewUserValidation(Model model, Principal principal) {
- try {
- model.addAttribute("user", usersService.getUserDtoForVerificationByUsername(principal.getName()));
- return "verification-photos";
- } catch (EntityNotFoundException e) {
- throw new ResponseStatusException(HttpStatus.NOT_FOUND, e.getMessage());
- }
- }
- @Secured({"ADMIN, USER"})
- @PostMapping("/user/verification")
- public String submitUserPhotosForVerification(@ModelAttribute(name = "user") UserDtoForVerification user, @RequestParam("selfiePhoto") MultipartFile selfiePhoto, @RequestParam("personalIdCardPhoto") MultipartFile personalIdCardPhoto, Principal principal) throws IOException {
- user.setSelfiePhoto(Base64.getEncoder().encodeToString(selfiePhoto.getBytes()));
- user.setPersonalIdCardPhoto(Base64.getEncoder().encodeToString(personalIdCardPhoto.getBytes()));
- usersService.updateUser(principal.getName(), user);
- return "redirect:/user";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement