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); } }