Search in sources :

Example 1 with UserModelDto

use of easytests.admin.dto.UserModelDto in project easy-tests by malinink.

the class UsersController method create.

@GetMapping("create/")
public String create(Model model) {
    final UserModelDto userModelDto = new UserModelDto();
    model.addAttribute("user", userModelDto);
    setCreateBehaviour(model);
    return "admin/users/form";
}
Also used : UserModelDto(easytests.admin.dto.UserModelDto)

Example 2 with UserModelDto

use of easytests.admin.dto.UserModelDto in project easy-tests by malinink.

the class UsersController method update.

@GetMapping("update/{userId}/")
public String update(Model model, @PathVariable Integer userId) {
    final UserModelInterface userModel = this.getUserModel(userId);
    final UserModelDto userModelDto = new UserModelDto();
    userModelDto.map(userModel);
    model.addAttribute("user", userModelDto);
    setUpdateBehaviour(model);
    return "admin/users/form";
}
Also used : UserModelInterface(easytests.core.models.UserModelInterface) UserModelDto(easytests.admin.dto.UserModelDto)

Example 3 with UserModelDto

use of easytests.admin.dto.UserModelDto in project easy-tests by malinink.

the class UserModelDtoValidator method validate.

public void validate(Object obj, Errors errors) {
    final UserModelDto userModelDto = (UserModelDto) obj;
    this.validateEmailIsUnique(errors, userModelDto);
    this.validatePassword(errors, userModelDto);
    this.validatePasswordRepeat(errors, userModelDto);
}
Also used : UserModelDto(easytests.admin.dto.UserModelDto)

Aggregations

UserModelDto (easytests.admin.dto.UserModelDto)3 UserModelInterface (easytests.core.models.UserModelInterface)1