From b0500fee9c01e17c81b9293b244c8ed88dc9ca29 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期五, 11 十月 2019 15:12:25 +0800
Subject: [PATCH] add swagger

---
 controllers/cluster.go |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/controllers/cluster.go b/controllers/cluster.go
index 5e9314c..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 {
@@ -173,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]
@@ -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 {

--
Gitblit v1.8.0