This commit is contained in:
parent
efbc815717
commit
e016cc5528
2 changed files with 6 additions and 8 deletions
|
|
@ -90,14 +90,13 @@ public class LauncherController extends AbstractQueueController {
|
|||
|
||||
@ApiOperation(value = "create specific launcher.")
|
||||
@ApiResponses(value = {@ApiResponse(code = 200, message = "OK", response = CudResponse.class), @ApiResponse(code = 400, message = "Ошибка валидации", response = BasicSpcexResponse.class)})
|
||||
@RequestMapping(value = "/specific/{task-code}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@RequestMapping(value = "/specific", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public CudResponse addSpecific(@ApiParam(value = "Код задания из taskDictionary", required = true, example = "ABLK")
|
||||
@PathVariable("task-code") String dictionaryName,
|
||||
public CudResponse addSpecific(@ApiParam(value = "Параметры команды в JSON формате.", required = true)
|
||||
@RequestBody LauncherNew launcherNew) throws ExecutionException, InterruptedException {
|
||||
AbstractDictionary taskEnum = taskDictionary.getSingleObjectByFieldValues(Map.of("code", dictionaryName));
|
||||
AbstractDictionary taskEnum = taskDictionary.getSingleObjectByFieldValues(Map.of("code", launcherNew.getTask()));
|
||||
if (taskEnum == null) {
|
||||
throw new NotFound404Exception("task dictionary element with code '" + dictionaryName + "'");
|
||||
throw new NotFound404Exception("task dictionary element with code '" + launcherNew.getTask() + "'");
|
||||
}
|
||||
if (!Task.startOfClearing.getKey().equals(taskEnum.getCode())) {
|
||||
throw new IllegalStateException(String.format("Task %s not support request with body", taskEnum.getCode()));
|
||||
|
|
@ -109,7 +108,7 @@ public class LauncherController extends AbstractQueueController {
|
|||
if (user == null) {
|
||||
throw new IllegalStateException("cannot obtain userId from logged in user " + username);
|
||||
}
|
||||
launcherCommand.setTask(dictionaryName);
|
||||
launcherCommand.setTask(launcherNew.getTask());
|
||||
launcherCommand.setUserId(user.getId());
|
||||
launcherCommand.setCompanyId(launcherNew.getCompanyId());
|
||||
launcherCommand.setSecurityId(launcherNew.getSecurityId());
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import ru.spcex.clearing.backendapi.domain.actions.IAction;
|
|||
import ru.spcex.clearing.backendapi.errors.BackEndError;
|
||||
import ru.spcex.clearing.platform.messaging.domain.ActionType;
|
||||
import ru.spcex.clearing.platform.messaging.domain.cud.schedule.LauncherCommandRequest;
|
||||
import ru.spcex.platform.enumeration.Task;
|
||||
import ru.spcex.platform.utils.enumeration.EnumMessage;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -24,7 +23,6 @@ public class LauncherNew implements IAction<Object> {
|
|||
@ApiModelProperty(value = "Идентификатор инструмента", example = "1000")
|
||||
@JsonProperty
|
||||
private Long securityId;
|
||||
|
||||
@JsonIgnore
|
||||
private Long userId;
|
||||
|
||||
|
|
@ -38,6 +36,7 @@ public class LauncherNew implements IAction<Object> {
|
|||
return taskRunnerCommandRequest;
|
||||
}
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@Override
|
||||
public ActionType getActionType() {
|
||||
return ActionType.NEW;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue