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

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