1. 添加策略模板API文档
This commit is contained in:
@@ -93,6 +93,9 @@ public interface TaskControllerApi {
|
||||
)
|
||||
)
|
||||
},
|
||||
parameters = {
|
||||
@Parameter(name = "taskId", description = "任务ID")
|
||||
},
|
||||
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(
|
||||
description = "任务信息,必须包含任务原有的或者添加/删除部分后的static_rule_ids和dynamic_rule_ids"
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.realtime.protection.server.task.status.StateHandler;
|
||||
public class GeneratingState extends StateHandler implements State {
|
||||
@Override
|
||||
public Boolean handle(State newState, CommandService commandService, TaskService taskService, Long taskId) throws DorisStartException {
|
||||
return switch(StateEnum.getStateEnumByState(newState)) {
|
||||
return switch (StateEnum.getStateEnumByState(newState)) {
|
||||
case RUNNING, GENERATING -> true;
|
||||
case FAILED -> handleFailed(commandService, taskId);
|
||||
default -> throw new IllegalStateException("Unexpected value: " + StateEnum.getStateEnumByState(newState));
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.realtime.protection.server.task.status.StateHandler;
|
||||
public class RunningState extends StateHandler implements State {
|
||||
@Override
|
||||
public Boolean handle(State newState, CommandService commandService, TaskService taskService, Long taskId) {
|
||||
return switch(StateEnum.getStateEnumByState(newState)) {
|
||||
return switch (StateEnum.getStateEnumByState(newState)) {
|
||||
case RUNNING, GENERATING -> true;
|
||||
case PAUSED -> handlePause(commandService, taskId);
|
||||
case STOP -> handleStop(commandService, taskId);
|
||||
|
||||
Reference in New Issue
Block a user