[server][ executor]- 完成同步调用命令的部分代码 - 1

This commit is contained in:
zeaslity
2023-02-28 15:55:05 +08:00
parent c36721eada
commit 65ed141697
5 changed files with 22 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ import io.swagger.annotations.ApiParam;
import io.wdd.common.beans.response.R;
import io.wdd.rpc.execute.result.BuildStreamReader;
import io.wdd.rpc.execute.service.AsyncExecutionService;
import io.wdd.rpc.execute.service.SyncExecutionService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -28,6 +29,8 @@ public class ExecutionController {
AsyncExecutionService asyncExecutionService;
@Resource
BuildStreamReader buildStreamReader;
@Resource
SyncExecutionService syncExecutionService;
@PostMapping("/command/one")
@ApiOperation("[命令] - 手动发送命令")
@@ -104,11 +107,13 @@ public class ExecutionController {
@RequestParam(value = "type", required = false) @ApiParam(name = "type", value = "执行命令类型") @Nullable String type
) {
return R.ok(asyncExecutionService.SendCommandToAgent(
ALL_HEALTHY_AGENT_TOPIC_NAME_LIST,
type,
commandList
));
return R.ok(
syncExecutionService.SyncSendCommandToAgent(
topicName,
type,
commandList
)
);
}