Search in sources :

Example 1 with IssueStandardModel

use of easytests.core.models.IssueStandardModel in project easy-tests by malinink.

the class IssueStandardsService method map.

private IssueStandardModelInterface map(IssueStandardEntity issueStandardEntity) {
    final IssueStandardModelInterface issueStandardModel = new IssueStandardModel();
    issueStandardModel.map(issueStandardEntity);
    return issueStandardModel;
}
Also used : IssueStandardModelInterface(easytests.core.models.IssueStandardModelInterface) IssueStandardModel(easytests.core.models.IssueStandardModel)

Example 2 with IssueStandardModel

use of easytests.core.models.IssueStandardModel in project easy-tests by malinink.

the class SubjectsController method create.

@PostMapping("create")
public String create(@Valid @NotNull SubjectDto subject, BindingResult bindingResult, Model model) {
    if (bindingResult.hasErrors()) {
        model.addAttribute("methodType", "create");
        model.addAttribute("subject", subject);
        model.addAttribute("errors", bindingResult);
        return "subjects/form";
    }
    final SubjectModelInterface subjectModel = new SubjectModel();
    subject.mapInto(subjectModel);
    subjectModel.setUser(this.getCurrentUserModel());
    subjectsService.save(subjectModel);
    final IssueStandardModelInterface issueStandardModel = new IssueStandardModel();
    issueStandardModel.setSubject(new SubjectModelEmpty(subjectModel.getId()));
    issueStandardsService.save(issueStandardModel);
    return "redirect:/personal/subjects/list";
}
Also used : SubjectModelEmpty(easytests.core.models.empty.SubjectModelEmpty) IssueStandardModelInterface(easytests.core.models.IssueStandardModelInterface) IssueStandardModel(easytests.core.models.IssueStandardModel) SubjectModel(easytests.core.models.SubjectModel) SubjectModelInterface(easytests.core.models.SubjectModelInterface)

Aggregations

IssueStandardModel (easytests.core.models.IssueStandardModel)2 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)2 SubjectModel (easytests.core.models.SubjectModel)1 SubjectModelInterface (easytests.core.models.SubjectModelInterface)1 SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)1