| | |
| | | Password string `json:"password"` |
| | | ClusterName string `json:"clusterName"` |
| | | ClusterId string `json:"clusterId"` |
| | | VirtualIp string `json:"virtualIp"` |
| | | } |
| | | |
| | | type ClusterSearchVo struct { |
| | |
| | | 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 { |
| | |
| | | // @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] |
| | |
| | | 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 { |