liuxiaolong
2019-09-28 8d96031e186d76b1b4d7d28350b43e02d76149ab
update virtualIp
3个文件已修改
15 ■■■■■ 已修改文件
controllers/cluster.go 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
go.mod 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
go.sum 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/cluster.go
@@ -40,6 +40,7 @@
    Password string `json:"password"`
    ClusterName string `json:"clusterName"`
    ClusterId string `json:"clusterId"`
    VirtualIp string `json:"virtualIp"`
}
type ClusterSearchVo struct {
@@ -70,7 +71,7 @@
        return
    }
    var api dbapi.ClusterApi
    b, d := api.Create(clusterVo.ClusterName, clusterVo.Password)
    b, d := api.Create(clusterVo.ClusterName, clusterVo.Password, clusterVo.VirtualIp)
    if b {
        util.ResponseFormat(c,code.Success, d)
    } else {
@@ -198,7 +199,8 @@
// @Description 保存集群名称
// @Produce json
// @Tags cluster
// @Param  clusterName query string true "集群名称"
// @Param clusterName formData string true "集群名称"
// @Param virtualIp formData string false "虚拟ip"
// @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/updateClusterName [post]
@@ -208,8 +210,9 @@
        util.ResponseFormat(c,code.RequestParamError, "参数有误")
        return
    }
    virtualIp := c.PostForm("virtualIp")
    var api dbapi.ClusterApi
    b,_ := api.UpdateClusterName(clusterName)
    b,_ := api.UpdateClusterName(clusterName,virtualIp)
    if b {
        util.ResponseFormat(c,code.UpdateSuccess,"更新成功")
    } else {
go.mod
@@ -3,7 +3,7 @@
go 1.12
require (
    basic.com/dbapi.git v0.0.0-20190927080434-1c6a6481f0ac // indirect
    basic.com/dbapi.git v0.0.0-20190928095850-a32d6c8af6e9 // indirect
    basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb // indirect
    basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48 // indirect
    basic.com/pubsub/esutil.git v0.0.0-20190807083318-4431a8860d47
go.sum
@@ -1,5 +1,5 @@
basic.com/dbapi.git v0.0.0-20190927080434-1c6a6481f0ac h1:yZfWw+pKZc+0CY/L9DvkLMzmPR2rxLU2oQ3TGB1XyZ8=
basic.com/dbapi.git v0.0.0-20190927080434-1c6a6481f0ac/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q=
basic.com/dbapi.git v0.0.0-20190928095850-a32d6c8af6e9 h1:elKxEm2v6fhuw1XidzOVuSBIl2xgMH64/LtsBBnqPCE=
basic.com/dbapi.git v0.0.0-20190928095850-a32d6c8af6e9/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q=
basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb h1:fM6DojeInFSCFO+wkba1jtyPiSDqw0jYKi4Tk+e+ka4=
basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb/go.mod h1:FTryK8BsVLfUplx8a3+l8hJWub6VbAWZCUH7sPRZaso=
basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48 h1:BBA30Rgljn6MRieC4gUncETJDyna3ObyubTo9HEQ2M0=