1. 添加策略模板API文档

This commit is contained in:
EnderByEndera
2024-01-12 19:24:19 +08:00
parent c1a5d2462f
commit 8a719709a3
33 changed files with 450 additions and 222 deletions

View File

@@ -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"
)

View File

@@ -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));

View File

@@ -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);