/*
|
* 【机场1】从 dock2 原类 com.ard.web.controller.sample.TopologyController 复制/独立适配(DJI Dock 1 / M30)。
|
* 与 dock2 原类同服务共存;本文件内的适配差异以「// 机场1:」内联注释标出。
|
*/
|
package com.ard.web.controller.sample.dock1;
|
|
import com.ard.sample.common.model.ResponseResult;
|
import com.ard.sample.manage.model.dto.TopologyDTO;
|
import com.ard.sample.manage.service.ITopologyService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
import java.util.Map;
|
import java.util.concurrent.ConcurrentHashMap;
|
import com.ard.web.controller.sample.TopologyController;
|
|
/**
|
* @author sean
|
* @version 0.2
|
* @date 2021/12/8
|
*/
|
@RestController
|
@RequestMapping("/dock1/workspaces")
|
public class Dock1TopologyController {
|
|
@Autowired
|
private ITopologyService topologyService;
|
|
/**
|
* Get the topology list of all devices in the current user workspace for pilot display.
|
* @param workspaceId
|
* @return
|
*/
|
@GetMapping("/{workspace_id}/devices/topologies")
|
public ResponseResult<Map<String, List<TopologyDTO>>> getDevicesTopologiesForPilot(
|
@PathVariable(name = "workspace_id") String workspaceId) {
|
List<TopologyDTO> topologyList = topologyService.getDeviceTopology(workspaceId);
|
return ResponseResult.success(new ConcurrentHashMap<>(Map.of("list", topologyList)));
|
}
|
|
}
|