diff --git a/server/src/main/java/io/wdd/rpc/controller/ExecutionController.java b/server/src/main/java/io/wdd/rpc/controller/ExecutionController.java index ad59f90..0bbc8f5 100644 --- a/server/src/main/java/io/wdd/rpc/controller/ExecutionController.java +++ b/server/src/main/java/io/wdd/rpc/controller/ExecutionController.java @@ -2,6 +2,7 @@ package io.wdd.rpc.controller; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +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.CoreExecutionService; @@ -16,7 +17,6 @@ import javax.annotation.Resource; import java.util.List; import static io.wdd.rpc.execute.result.RedisStreamReaderConfig.AGENT_STATUS_REDIS_STREAM_LISTENER_CONTAINER; -import static io.wdd.rpc.execute.result.RedisStreamReaderConfig.COMMAND_RESULT_REDIS_STREAM_LISTENER_CONTAINER; @RestController @RequestMapping("/octopus/server/executor") @@ -31,6 +31,7 @@ public class ExecutionController { @PostMapping("command") + @ApiOperation("[命令]-手动发送命令") public R patchCommandToAgent( @RequestParam(value = "topicName") String topicName, @RequestParam(value = "commandList", required = false) @Nullable List commandList, @@ -55,21 +56,11 @@ public class ExecutionController { return R.ok(streamKey); } - @PostMapping("/stream") - public void GetCommandLog( - @RequestParam(value = "streamKey") String streamKey - ) { - - buildStreamReader.registerStreamReader( - COMMAND_RESULT_REDIS_STREAM_LISTENER_CONTAINER, - streamKey - ); - } - @PostMapping("/agentStatusStream") - public void getAgentStatus( - @RequestParam(value = "streamKey") String streamKey + @ApiOperation("切换Console查看Agent状态日志") + public R getAgentStatusStrem( + @RequestParam(value = "streamKey") @ApiParam(value = "status的Stream Key") String streamKey ) { buildStreamReader.registerStreamReader( @@ -77,6 +68,8 @@ public class ExecutionController { streamKey ); + return R.ok("请到控制台查看,已经切换至 => " + streamKey); + } diff --git a/server/src/main/java/io/wdd/rpc/execute/service/CoreExecutionServiceImpl.java b/server/src/main/java/io/wdd/rpc/execute/service/CoreExecutionServiceImpl.java index 8a0b7c8..9e3a30c 100644 --- a/server/src/main/java/io/wdd/rpc/execute/service/CoreExecutionServiceImpl.java +++ b/server/src/main/java/io/wdd/rpc/execute/service/CoreExecutionServiceImpl.java @@ -87,7 +87,7 @@ public class CoreExecutionServiceImpl implements CoreExecutionService { String resultKey = futureKey; // 判定是否是 FutureKey - if (StringUtils.isEmpty(agentTopicName)) { + if (null == futureKey) { resultKey = ExecutionMessage.GetResultKey(agentTopicName); }