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