From f903c085b8adde79c3aeca453a9b935adb1ef033 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期六, 26 十月 2019 14:16:58 +0800 Subject: [PATCH] fix uout --- controllers/cluster.go | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/controllers/cluster.go b/controllers/cluster.go index 7ac903d..749d249 100644 --- a/controllers/cluster.go +++ b/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 { @@ -154,18 +155,12 @@ // @Description 閫氳繃searchNum鍋滄鎼滅储 // @Produce json // @Tags cluster -// @Param searchNum query string true "鎼滅储缂栧彿" // @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/stopSearching [post] func (cc ClusterController) StopSearching(c *gin.Context) { - searchNum := c.Query("searchNum") - if searchNum == "" { - util.ResponseFormat(c,code.RequestParamError, "鍙傛暟鏈夎") - return - } var api dbapi.ClusterApi - b, d := api.StopSearching(searchNum) + b, d := api.StopSearching("") if b { util.ResponseFormat(c,code.Success, d) } else { @@ -179,7 +174,7 @@ // @Accept json // @Produce json // @Tags cluster -// @Param clusterArg body controllers.ClusterCreateVo true "闆嗙兢鍒涘缓鍙傛暟" +// @Param clusterArg body controllers.ClusterJoinVo true "闆嗙兢鍒涘缓鍙傛暟" // @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/joinCluster [post] @@ -204,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] @@ -214,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 { -- Gitblit v1.8.0