nishiwei
5 days ago 3f43e40ed1a1e9f66b3ad2862da9dbc4b710c712
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * 【机场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)));
    }
 
}