Search in sources :

Example 1 with TopicDto

use of easytests.personal.dto.TopicDto in project easy-tests by malinink.

the class TopicsController method update.

@GetMapping("update/{topicId}/")
public String update(Model model, @PathVariable Integer topicId, @PathVariable("subjectId") Integer subjectId) {
    final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, false);
    final TopicModelInterface topicModel = this.getTopicModel(topicId, subjectId);
    final TopicDto topic = new TopicDto();
    topic.map(topicModel);
    setUpdateBehaviour(model);
    model.addAttribute("topic", topic);
    model.addAttribute("subjectId", subjectId);
    return "topics/form";
}
Also used : TopicDto(easytests.personal.dto.TopicDto) SubjectModelInterface(easytests.core.models.SubjectModelInterface) TopicModelInterface(easytests.core.models.TopicModelInterface) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 2 with TopicDto

use of easytests.personal.dto.TopicDto in project easy-tests by malinink.

the class TopicsController method create.

@GetMapping("create/")
public String create(Model model, @PathVariable("subjectId") Integer subjectId) {
    final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, false);
    final TopicDto topic = new TopicDto();
    setCreateBehaviour(model);
    model.addAttribute("topic", topic);
    model.addAttribute("subjectId", subjectId);
    return "topics/form";
}
Also used : TopicDto(easytests.personal.dto.TopicDto) SubjectModelInterface(easytests.core.models.SubjectModelInterface) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

SubjectModelInterface (easytests.core.models.SubjectModelInterface)2 TopicDto (easytests.personal.dto.TopicDto)2 GetMapping (org.springframework.web.bind.annotation.GetMapping)2 TopicModelInterface (easytests.core.models.TopicModelInterface)1