use of com.zavada.domain.EditUserRequest in project Logos_Materials_October_2017 by VolodymyrZavada.
the class UserController method editUserProfile.
@GetMapping("/edit/{userId}")
public String editUserProfile(@PathVariable("userId") int userId, Model model, Principal principal) {
UserEntity entity = userService.findUserByEmail(principal.getName());
if (userId != entity.getId())
return "redirect:/user";
EditUserRequest request = UserMapper.entityToEditUser(entity);
model.addAttribute("editModel", request);
return "user/edit";
}
use of com.zavada.domain.EditUserRequest in project Logos_Materials_October_2017 by VolodymyrZavada.
the class UserMapper method entityToEditUser.
// Edit user
public static EditUserRequest entityToEditUser(UserEntity entity) {
EditUserRequest request = new EditUserRequest();
request.setId(entity.getId());
request.setEmail(entity.getEmail());
request.setFirstName(entity.getFirstName());
request.setLastName(entity.getLastName());
request.setAge(entity.getAge());
request.setPhoneNumber(entity.getPhoneNumber());
// <----
request.setPassword(entity.getPassword());
return request;
}
Aggregations