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

Unify type of estimatedDuration of TrainingPhase, minor fix in swagger

Related to #3
parent 197f2215
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ public class TasksController { ...@@ -41,7 +41,7 @@ public class TasksController {
@ApiOperation(httpMethod = "POST", @ApiOperation(httpMethod = "POST",
value = "Create a new task in a phase", value = "Create a new task in a phase",
notes = "Creates a new default task in a specified game phase", notes = "Creates a new default task in a specified training phase",
response = TaskDto.class, response = TaskDto.class,
nickname = "createTask", nickname = "createTask",
produces = MediaType.APPLICATION_JSON_VALUE produces = MediaType.APPLICATION_JSON_VALUE
...@@ -54,7 +54,7 @@ public class TasksController { ...@@ -54,7 +54,7 @@ public class TasksController {
public ResponseEntity<TaskDto> createTask( public ResponseEntity<TaskDto> createTask(
@ApiParam(value = "Training definition ID", required = true) @ApiParam(value = "Training definition ID", required = true)
@PathVariable(name = "definitionId") Long definitionId, @PathVariable(name = "definitionId") Long definitionId,
@ApiParam(value = "Game phase ID", required = true) @ApiParam(value = "Training phase ID", required = true)
@PathVariable(name = "phaseId") Long phaseId) { @PathVariable(name = "phaseId") Long phaseId) {
TaskDto createdTask = taskService.createDefaultTask(definitionId, phaseId); TaskDto createdTask = taskService.createDefaultTask(definitionId, phaseId);
...@@ -63,7 +63,7 @@ public class TasksController { ...@@ -63,7 +63,7 @@ public class TasksController {
} }
@ApiOperation(httpMethod = "POST", @ApiOperation(httpMethod = "POST",
value = "Clone task inside of the game phase", value = "Clone task inside of the training phase",
notes = "Creates a new task with the same properties as the specified task (pattern)", notes = "Creates a new task with the same properties as the specified task (pattern)",
response = TaskDto.class, response = TaskDto.class,
nickname = "cloneTask", nickname = "cloneTask",
...@@ -77,7 +77,7 @@ public class TasksController { ...@@ -77,7 +77,7 @@ public class TasksController {
public ResponseEntity<TaskDto> cloneTask( public ResponseEntity<TaskDto> cloneTask(
@ApiParam(value = "Training definition ID", required = true) @ApiParam(value = "Training definition ID", required = true)
@PathVariable(name = "definitionId") Long definitionId, @PathVariable(name = "definitionId") Long definitionId,
@ApiParam(value = "Game phase ID", required = true) @ApiParam(value = "Training phase ID", required = true)
@PathVariable(name = "phaseId") Long phaseId, @PathVariable(name = "phaseId") Long phaseId,
@ApiParam(value = "Task ID", required = true) @ApiParam(value = "Task ID", required = true)
@PathVariable(name = "taskId") Long taskId) { @PathVariable(name = "taskId") Long taskId) {
...@@ -89,7 +89,7 @@ public class TasksController { ...@@ -89,7 +89,7 @@ public class TasksController {
@ApiOperation(httpMethod = "GET", @ApiOperation(httpMethod = "GET",
value = "Get tasks", value = "Get tasks",
notes = "Get tasks detail associated with the specified game phase", notes = "Get tasks detail associated with the specified training phase",
response = TaskDto.class, response = TaskDto.class,
nickname = "getTask", nickname = "getTask",
produces = MediaType.APPLICATION_JSON_VALUE produces = MediaType.APPLICATION_JSON_VALUE
...@@ -102,7 +102,7 @@ public class TasksController { ...@@ -102,7 +102,7 @@ public class TasksController {
public ResponseEntity<TaskDto> getTask( public ResponseEntity<TaskDto> getTask(
@ApiParam(value = "Training definition ID", required = true) @ApiParam(value = "Training definition ID", required = true)
@PathVariable(name = "definitionId") Long definitionId, @PathVariable(name = "definitionId") Long definitionId,
@ApiParam(value = "Game phase ID", required = true) @ApiParam(value = "Training phase ID", required = true)
@PathVariable(name = "phaseId") Long phaseId, @PathVariable(name = "phaseId") Long phaseId,
@ApiParam(value = "Task ID", required = true) @ApiParam(value = "Task ID", required = true)
@PathVariable(name = "taskId") Long taskId) { @PathVariable(name = "taskId") Long taskId) {
...@@ -126,7 +126,7 @@ public class TasksController { ...@@ -126,7 +126,7 @@ public class TasksController {
public ResponseEntity<TaskDto> updateTask( public ResponseEntity<TaskDto> updateTask(
@ApiParam(value = "Training definition ID", required = true) @ApiParam(value = "Training definition ID", required = true)
@PathVariable(name = "definitionId") Long definitionId, @PathVariable(name = "definitionId") Long definitionId,
@ApiParam(value = "Game phase ID", required = true) @ApiParam(value = "Training phase ID", required = true)
@PathVariable(name = "phaseId") Long phaseId, @PathVariable(name = "phaseId") Long phaseId,
@ApiParam(value = "Task ID", required = true) @ApiParam(value = "Task ID", required = true)
@PathVariable(name = "taskId") Long taskId, @PathVariable(name = "taskId") Long taskId,
...@@ -153,7 +153,7 @@ public class TasksController { ...@@ -153,7 +153,7 @@ public class TasksController {
public ResponseEntity<Void> removeTask( public ResponseEntity<Void> removeTask(
@ApiParam(value = "Training definition ID", required = true) @ApiParam(value = "Training definition ID", required = true)
@PathVariable(name = "definitionId") Long definitionId, @PathVariable(name = "definitionId") Long definitionId,
@ApiParam(value = "Game phase ID", required = true) @ApiParam(value = "Training phase ID", required = true)
@PathVariable(name = "phaseId") Long phaseId, @PathVariable(name = "phaseId") Long phaseId,
@ApiParam(value = "Task ID", required = true) @ApiParam(value = "Task ID", required = true)
@PathVariable(name = "taskId") Long taskId) { @PathVariable(name = "taskId") Long taskId) {
......
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
@Entity @Entity
public class TrainingPhase extends AbstractPhase { public class TrainingPhase extends AbstractPhase {
private String estimatedDuration; private int estimatedDuration;
private int allowedCommands; private int allowedCommands;
private int allowedWrongFlags; private int allowedWrongFlags;
...@@ -27,11 +27,11 @@ public class TrainingPhase extends AbstractPhase { ...@@ -27,11 +27,11 @@ public class TrainingPhase extends AbstractPhase {
@OneToMany(mappedBy = "relatedTrainingPhase", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) @OneToMany(mappedBy = "relatedTrainingPhase", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
private List<QuestionPhaseRelation> questionPhaseRelations = new ArrayList<>(); private List<QuestionPhaseRelation> questionPhaseRelations = new ArrayList<>();
public String getEstimatedDuration() { public int getEstimatedDuration() {
return estimatedDuration; return estimatedDuration;
} }
public void setEstimatedDuration(String estimatedDuration) { public void setEstimatedDuration(int estimatedDuration) {
this.estimatedDuration = estimatedDuration; this.estimatedDuration = estimatedDuration;
} }
......
...@@ -5,18 +5,18 @@ import java.util.List; ...@@ -5,18 +5,18 @@ import java.util.List;
public class TrainingPhaseDto extends AbstractPhaseDto { public class TrainingPhaseDto extends AbstractPhaseDto {
private String estimatedDuration; private int estimatedDuration;
private int allowedCommands; private int allowedCommands;
private int allowedWrongFlags; private int allowedWrongFlags;
private List<TaskDto> tasks = new ArrayList<>(); private List<TaskDto> tasks = new ArrayList<>();
private List<DecisionMatrixRowDto> decisionMatrix; private List<DecisionMatrixRowDto> decisionMatrix;
public String getEstimatedDuration() { public int getEstimatedDuration() {
return estimatedDuration; return estimatedDuration;
} }
public void setEstimatedDuration(String estimatedDuration) { public void setEstimatedDuration(int estimatedDuration) {
this.estimatedDuration = estimatedDuration; this.estimatedDuration = estimatedDuration;
} }
......
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