liuxiaolong
2019-05-06 0bc4f4c791437b39b8c30624f5c21f8c855dc61d
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
package com.cloud.retrieve.controller;
 
import com.cloud.model.common.Result;
import com.cloud.retrieve.service.ClusterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
 
@Slf4j
@Api(value = "ClusterController", description = "集群管理")
@RequestMapping("/data/api-d/cluster")
@RestController
public class ClusterController {
 
    @Autowired
    private ClusterService clusterService;
 
    @RequestMapping("/getClusterDeviceTree")
    @ApiOperation(value = "获取集群设备树信息", notes = "获取集群设备树信息", httpMethod = "POST", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    public List getClusterDeviceTree(){
        return clusterService.getClusterDeviceTree();
    }
 
    @GetMapping("/findClusterList")
    @ApiOperation(value = "查询集群-节点-设备列表", notes = "查询集群-节点-设备列表", httpMethod = "GET", produces = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "点击节点类型(1:集群,2:节点,3:设备)", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "id", value = "点击节点id", required = true, dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "condition", value = "设备名称/设备地址", required = false, dataType = "String", paramType = "query")
    })
    public Result findClusterList(String type, String id, String condition){
 
        return clusterService.findClusterList(type, id, condition);
    }
 
}