1. 添加策略模板API文档
This commit is contained in:
@@ -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