class ExchangeController {

    @Autowired
    private AgentsService agentsService;
    @Autowired
    private DevicesService devicesService;

    @WebAspect
    @Operation(summary = "重启设备", description = "根据 id 重启特定设备")
    @GetMapping("/reboot")
    public RespModel<String> reboot(@RequestParam(name = "id") int id) {

        Devices devices = devicesService.findById(id);
        Agents agents = agentsService.findById(devices.getAgentId());
        if (ObjectUtils.isEmpty(agents)) {
            return new RespModel<>(RespEnum.AGENT_NOT_ONLINE);
        }
        if (ObjectUtils.isEmpty(devices)) {
            return new RespModel<>(RespEnum.DEVICE_NOT_FOUND);
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("msg", "reboot");
        jsonObject.put("udId", devices.getUdId());
        jsonObject.put("platform", devices.getPlatform());
        TransportWorker.send(agents.getId(), jsonObject);
        return new RespModel<>(RespEnum.HANDLE_OK);
    }

    @WebAspect
    @Operation(summary = "下线agent", description = "下线指定的 agent")
    @GetMapping("/stop")
    public RespModel<String> stop(@RequestParam(name = "id") int id) {<FILL_FUNCTION_BODY>}

    //eureka调度用
    @WebAspect
    @WhiteUrl
    @PostMapping("/send")
    public RespModel<String> send(@RequestParam(name = "id") int id, @RequestBody JSONObject jsonObject) {
        Session agentSession = BytesTool.agentSessionMap.get(id);
        if (agentSession != null) {
            BytesTool.sendText(agentSession, jsonObject.toJSONString());
        }
        return new RespModel<>(RespEnum.SEND_OK);
    }
}

        Agents agents = agentsService.findById(id);
        if (agents.getStatus() != AgentStatus.ONLINE) {
            return new RespModel<>(2000, "stop.agent.not.online");
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("msg", "shutdown");
        TransportWorker.send(agents.getId(), jsonObject);
        return new RespModel<>(RespEnum.HANDLE_OK);
    
<no_super_class>