use of com.zavada.domain.UserProfileRequest in project Logos_Materials_October_2017 by VolodymyrZavada.
the class UserController method showUserProfile.
@GetMapping
public String showUserProfile(Model model, Principal principal) throws IOException {
System.out.println("Secured user name: " + principal.getName());
UserEntity entity = userService.findUserByEmail(principal.getName());
if (entity == null)
return "redirect:/";
UserProfileRequest request = UserMapper.entityToUserProfile(entity);
model.addAttribute("userProfile", request);
model.addAttribute("imageSrc", CustomFileUtils.getImage("user_" + entity.getId(), entity.getImagePath()));
return "user/profile";
}
use of com.zavada.domain.UserProfileRequest in project Logos_Materials_October_2017 by VolodymyrZavada.
the class UserMapper method entityToUserProfile.
public static UserProfileRequest entityToUserProfile(UserEntity entity) {
UserProfileRequest request = new UserProfileRequest();
request.setId(entity.getId());
request.setEmail(entity.getEmail());
request.setFirstName(entity.getFirstName());
request.setLastName(entity.getLastName());
request.setAge(entity.getAge());
request.setPhoneNumber(entity.getPhoneNumber());
return request;
}
Aggregations