liuxiaolong
2019-08-22 af315220b3c0b448f562c601222d68b6ab0ebe76
add FindCluster
2个文件已修改
18 ■■■■■ 已修改文件
controllers/cluster.go 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/router.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/cluster.go
@@ -90,6 +90,23 @@
    util.ResponseFormat(c,code.Success,pwd)
}
// @Summary 查询本地集群
// @Description 查询本地集群
// @Produce json
// @Tags cluster
// @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}"
// @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}"
// @Router /data/api-v/cluster/findCluster [get]
func (cc ClusterController) FindCluster(c *gin.Context) {
    var clusterApi dbapi.ClusterApi
    b, d := clusterApi.FindCluster()
    if b {
        util.ResponseFormat(c,code.Success, d)
    } else {
        util.ResponseFormat(c,code.ComError,"集群查询失败")
    }
}
// @Summary 搜索集群
// @Description 搜索集群
// @Accept json
router/router.go
@@ -226,6 +226,7 @@
    }
    clusterApi := r.Group(urlPrefix+"/cluster")
    {
        clusterApi.GET("/findCluster", clusterController.FindCluster)
        clusterApi.GET("/randomPwd", clusterController.RandomPwd)
        clusterApi.POST("/create", clusterController.Create)
        clusterApi.POST("/search", clusterController.Search)