From d9e01c51a525adf4f2393a95f87604e3b6e79ad2 Mon Sep 17 00:00:00 2001 From: sunty <1172534965@qq.com> Date: 星期二, 19 十一月 2019 15:57:19 +0800 Subject: [PATCH] fix all --- controllers/dbtableperson.go | 83 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 74 insertions(+), 9 deletions(-) diff --git a/controllers/dbtableperson.go b/controllers/dbtableperson.go index a9a7123..06ab88b 100644 --- a/controllers/dbtableperson.go +++ b/controllers/dbtableperson.go @@ -28,6 +28,7 @@ type DbPersonController struct { } +// @Security ApiKeyAuth // @Summary 娣诲姞搴曞簱浜哄憳 // @Description 娣诲姞搴曞簱浜哄憳 // @Accept json @@ -81,6 +82,7 @@ return result } +// @Security ApiKeyAuth // @Summary 淇敼搴曞簱浜哄憳 // @Description 淇敼搴曞簱浜哄憳 // @Accept json @@ -108,6 +110,7 @@ } } +// @Security ApiKeyAuth // @Summary 搴曞簱浜哄憳浠ュ浘鎼滃浘 // @Description 搴曞簱浜哄憳浠ュ浘鎼滃浘 // @Accept json @@ -240,11 +243,12 @@ return resultList } +// @Security ApiKeyAuth // @Summary 鏇存柊搴曞簱浜鸿劯鐓х墖 // @Description 鏇存柊搴曞簱浜鸿劯鐓х墖 -// @Accept json +// @Accept multipart/form-data // @Produce json -// @Tags 搴曞簱浜哄憳 +// @Tags dbperson 搴曞簱浜哄憳 // @Param id formData string true "浜哄憳id" // @Param file formData file true "浜鸿劯鍥剧墖" // @Success 200 {string} json "{"code":200, msg:"", success:true}" @@ -366,6 +370,7 @@ return message } +// @Security ApiKeyAuth // @Summary 鍒犻櫎搴曞簱浜哄憳 // @Description 鍒犻櫎搴撲汉鍛� // @Accept x-www-form-urlencoded @@ -393,6 +398,7 @@ type DelMultiPerson []string +// @Security ApiKeyAuth // @Summary 鍒犻櫎搴曞簱浜哄憳 // @Description 鍒犻櫎搴撲汉鍛� // @Accept json @@ -422,6 +428,7 @@ } } +// @Security ApiKeyAuth // @Summary 鏌ヨ搴曞簱浜哄憳鍒楄〃 // @Description 鏌ヨ搴撲汉鍛樺垪琛� // @Accept json @@ -491,16 +498,17 @@ TableIds []string `json:"tableIds"` } +// @Security ApiKeyAuth // @Summary 鎶撴媿浜哄憳鍔犲叆搴曞簱 // @Description 鎶撴媿浜哄憳鍔犲叆搴曞簱 // @Accept json // @Produce json -// @Tags es +// @Tags dbperson 搴曞簱浜哄憳 // @Param obj body controllers.JoinDbTVo true "搴曞簱鏁版嵁" // @Success 200 {string} json "{"code":200, msg:"鐩綍缁撴瀯鏁版嵁", success:true}" // @Failure 500 {string} json "{"code":500, msg:"杩斿洖閿欒淇℃伅", success:false}" // @Router /data/api-v/dbperson/joinDbTable [POST] -func (sc *DbPersonController) JoinDbTable(c *gin.Context) { +func (dbc *DbPersonController) JoinDbTable(c *gin.Context) { var reqBody JoinDbTVo c.BindJSON(&reqBody) if reqBody.CaptureId == "" || len(reqBody.TableIds) ==0 { @@ -539,10 +547,67 @@ } type DbtSearch struct { - TableId string `json:"tableId"` - OrderName string `json:"orderName"` - OrderType string `json:"orderType"` + TableId string `json:"tableId"` + OrderName string `json:"orderName"` + OrderType string `json:"orderType"` ContentValue string `json:"contentValue"` - Page int `json:"page"` - Size int `json:"size"` + Page int `json:"page"` + Size int `json:"size"` } + +type DbPersonMove struct { + PersonId string `json:"personId"` + TableIds []string `json:"tableIds"` +} + +// @Security ApiKeyAuth +// @Summary 浜哄憳绉诲姩 +// @Description 浜哄憳绉诲姩 +// @Accept json +// @Produce json +// @Tags dbperson 搴曞簱浜哄憳 +// @Param obj body controllers.DbPersonMove true "绉诲姩鍙傛暟" +// @Success 200 {string} json "{"code":200, msg:"", success:true}" +// @Failure 500 {string} json "{"code":500, msg:"", success:false}" +// @Router /data/api-v/dbperson/move [POST] +func (dbc *DbPersonController) Move(c *gin.Context) { + var reqBody DbPersonMove + c.BindJSON(&reqBody) + if reqBody.PersonId == "" || len(reqBody.TableIds) == 0 { + util.ResponseFormat(c,code.RequestParamError, "鍙傛暟鏈夎") + return + } + var dbpApi dbapi.DbPersonApi + b,d := dbpApi.Move(reqBody.PersonId, reqBody.TableIds) + if b { + util.ResponseFormat(c,code.Success,d) + } else { + util.ResponseFormat(c,code.ComError,"") + } +} + +// @Security ApiKeyAuth +// @Summary 浜哄憳澶嶅埗 +// @Description 浜哄憳澶嶅埗 +// @Accept json +// @Produce json +// @Tags dbperson 搴曞簱浜哄憳 +// @Param obj body controllers.DbPersonMove true "澶嶅埗鍙傛暟" +// @Success 200 {string} json "{"code":200, msg:"", success:true}" +// @Failure 500 {string} json "{"code":500, msg:"", success:false}" +// @Router /data/api-v/dbperson/copy [POST] +func (dbc *DbPersonController) Copy(c *gin.Context) { + var reqBody DbPersonMove + c.BindJSON(&reqBody) + if reqBody.PersonId == "" || len(reqBody.TableIds) == 0 { + util.ResponseFormat(c,code.RequestParamError, "鍙傛暟鏈夎") + return + } + var dbpApi dbapi.DbPersonApi + b,d := dbpApi.Copy(reqBody.PersonId, reqBody.TableIds) + if b { + util.ResponseFormat(c,code.Success,d) + } else { + util.ResponseFormat(c,code.ComError,"") + } +} \ No newline at end of file -- Gitblit v1.8.0