Skip to content
Snippets Groups Projects
Commit eb6dd97c authored by Jan Tymel's avatar Jan Tymel
Browse files

TaskUpdateDto is no longer a subclass of BaseLevelDto

Resolves #6
parent 670520b4
No related branches found
No related tags found
No related merge requests found
package com.example.demo.dto;
import java.io.Serializable;
import java.util.List;
public class TaskDto extends TaskUpdateDto implements Serializable {
public class TaskDto extends BaseLevelDto implements Serializable {
private Long id;
private String content;
private boolean solutionPenalized;
private String flag;
private String solution;
private Long incorrectFlagLimit;
public Long getId() {
return id;
private List<AttachmentDto> attachments;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public boolean isSolutionPenalized() {
return solutionPenalized;
}
public void setId(Long id) {
this.id = id;
public void setSolutionPenalized(boolean solutionPenalized) {
this.solutionPenalized = solutionPenalized;
}
public String getFlag() {
return flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
public String getSolution() {
return solution;
}
public void setSolution(String solution) {
this.solution = solution;
}
public List<AttachmentDto> getAttachments() {
return attachments;
}
public void setAttachments(List<AttachmentDto> attachments) {
this.attachments = attachments;
}
public Long getIncorrectFlagLimit() {
return incorrectFlagLimit;
}
public void setIncorrectFlagLimit(Long incorrectFlagLimit) {
this.incorrectFlagLimit = incorrectFlagLimit;
}
@Override
public String toString() {
return "TaskDto{" +
"id=" + id +
"} " + super.toString();
"content='" + content + '\'' +
", solutionPenalized=" + solutionPenalized +
", flag='" + flag + '\'' +
", solution='" + solution + '\'' +
", incorrectFlagLimit='" + incorrectFlagLimit + '\'' +
", attachments=" + attachments +
"} " + super.toString();
}
}
......@@ -2,8 +2,10 @@ package com.example.demo.dto;
import java.util.List;
public class TaskUpdateDto extends BaseLevelDto {
public class TaskUpdateDto {
private Long id;
private String title;
private String content;
private boolean solutionPenalized;
private String flag;
......@@ -12,6 +14,26 @@ public class TaskUpdateDto extends BaseLevelDto {
private List<AttachmentDto> attachments;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public boolean isSolutionPenalized() {
return solutionPenalized;
}
public String getContent() {
return content;
}
......@@ -63,12 +85,14 @@ public class TaskUpdateDto extends BaseLevelDto {
@Override
public String toString() {
return "TaskUpdateDto{" +
"content='" + content + '\'' +
", solutionPenalized='" + solutionPenalized + '\'' +
", flag='" + flag + '\'' +
", solution='" + solution + '\'' +
", attachments='" + attachments + '\'' +
", incorrectFlagLimit='" + incorrectFlagLimit + '\'' +
"} " + super.toString();
"id=" + id +
", title='" + title + '\'' +
", content='" + content + '\'' +
", solutionPenalized=" + solutionPenalized +
", flag='" + flag + '\'' +
", solution='" + solution + '\'' +
", incorrectFlagLimit=" + incorrectFlagLimit +
", attachments=" + attachments +
'}';
}
}
......@@ -94,6 +94,7 @@ public class TaskService {
taskUpdate.setPhaseLevel(persistedTask.get().getPhaseLevel());
taskUpdate.setTrainingDefinitionId(persistedTask.get().getTrainingDefinitionId());
taskUpdate.setOrder(persistedTask.get().getOrder());
Task savedEntity = taskRepository.save(taskUpdate);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment