From b0d994de43a1a654e046d9e0a16962a9f2e069a9 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期二, 24 九月 2019 20:28:05 +0800 Subject: [PATCH] fix rule get tables --- controllers/dbtablesCon.go | 22 ++++++++++++++++++++-- go.sum | 4 ++-- go.mod | 2 +- router/router.go | 1 + 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/controllers/dbtablesCon.go b/controllers/dbtablesCon.go index 9436848..40c52dc 100644 --- a/controllers/dbtablesCon.go +++ b/controllers/dbtablesCon.go @@ -26,8 +26,8 @@ // @Produce json // @Tags dbtable // @Param isSync path string true "鏄惁鍚屾搴� 1 鍚屾搴� 2鏈湴搴� qita 鍏ㄩ儴搴�" -// @Success 200 {string} json "{"code":200, msg:"鐩綍缁撴瀯鏁版嵁", success:true}" -// @Failure 500 {string} json "{"code":500, msg:"杩斿洖閿欒淇℃伅", success:false}" +// @Success 200 {string} json "{"code":200, msg:"", success:true}" +// @Failure 500 {string} json "{"code":500, msg:"", success:false}" // @Router /data/api-v/dbtable/queryDbTables/{isSync} [POST] func (dbt DbTableController) QueryDbTables(c *gin.Context) { isSync := c.Params.ByName("isSync") @@ -40,6 +40,24 @@ } } +// @Summary 鏌ヨ鏈満鎵�鏈夊簳搴撳垪琛� +// @Description 鏌ヨ鏈満鎵�鏈夊簳搴撳垪琛� +// @Accept x-www-form-urlencoded +// @Produce json +// @Tags dbtable +// @Success 200 {string} json "{"code":200, msg:"", success:true}" +// @Failure 500 {string} json "{"code":500, msg:"", success:false}" +// @Router /data/api-v/dbtable/findAllDbTablesByCurServer [GET] +func (dbt DbTableController) FindAllDbTablesByCurServer(c *gin.Context) { + var api dbapi.DbTableApi + arr,e := api.FindAllDbTablesByCurServer() + if e == nil { + util.ResponseFormat(c,code.Success, arr) + } else { + util.ResponseFormat(c,code.ComError,[]interface{}{}) + } +} + // 渚濇嵁搴曞簱id 鏌ヨ鏁版嵁 func QueryDbTableInfo(tableId string) map[string]interface{} { localConf, err2 := cache.GetServerInfo() diff --git a/go.mod b/go.mod index ecfed95..c6c8d69 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ basic.com/pubsub/esutil.git v0.0.0-20190807083318-4431a8860d47 basic.com/pubsub/protomsg.git v0.0.0-20190829113947-eb5a5f99a745 basic.com/syncdb.git v0.0.0-20190806090534-6ef6050a854c // indirect - basic.com/valib/capture.git v0.0.0-20190814090311-ea35d908c05e + basic.com/valib/capture.git v0.0.0-20190924061718-7e98d8c98b3c // indirect basic.com/valib/deliver.git v0.0.0-20190531095353-25d8c3b20051 basic.com/valib/goffmpeg.git v0.0.0-20190910083410-a6dd7933e0bd // indirect basic.com/valib/gopherdiscovery.git v0.0.0-20190605034340-15d89d8b4e28 // indirect diff --git a/go.sum b/go.sum index 8648eff..a17c3e8 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ basic.com/syncdb.git v0.0.0-20190805014629-7d1bbdc8a9a4/go.mod h1:3cYYJrG9ZR+RG+LA8+HOQb8EIdjmN3Mb4vOphNzLxEk= basic.com/syncdb.git v0.0.0-20190806090534-6ef6050a854c h1:OimNJgMUu071gVLqsS3IDCVSCKuxJaY8RtB/7W2goZM= basic.com/syncdb.git v0.0.0-20190806090534-6ef6050a854c/go.mod h1:3cYYJrG9ZR+RG+LA8+HOQb8EIdjmN3Mb4vOphNzLxEk= -basic.com/valib/capture.git v0.0.0-20190814090311-ea35d908c05e h1:U5hpkS5pOYMIz5/iB5iKcRTKo+Z6vuwEyJ8T2MxmgH0= -basic.com/valib/capture.git v0.0.0-20190814090311-ea35d908c05e/go.mod h1:y+h7VUnoSQ3jOtf2K3twXNA8fYDfyUsifSswcyKLgNw= +basic.com/valib/capture.git v0.0.0-20190924061718-7e98d8c98b3c h1:aNujtcGxq0cNLSK08cCamAiUYiQ2/ZsUMNXbX2w8Clc= +basic.com/valib/capture.git v0.0.0-20190924061718-7e98d8c98b3c/go.mod h1:y+h7VUnoSQ3jOtf2K3twXNA8fYDfyUsifSswcyKLgNw= basic.com/valib/deliver.git v0.0.0-20190531095353-25d8c3b20051/go.mod h1:bkYiTUGzckyNOjAgn9rB/DOjFzwoSHJlruuWQ6hu6IY= basic.com/valib/goffmpeg.git v0.0.0-20190910083410-a6dd7933e0bd h1:nEfjSIiKfPuhEIjra8AryyPCnXxph09SLOdeYjw/l98= basic.com/valib/goffmpeg.git v0.0.0-20190910083410-a6dd7933e0bd/go.mod h1:1x75Hawh/BjgPsQtuJ24px89gzk3uAslD8e0Xs6Z7GQ= diff --git a/router/router.go b/router/router.go index 5c06bc7..dfc13e6 100644 --- a/router/router.go +++ b/router/router.go @@ -164,6 +164,7 @@ vdbtable.POST("/deleteDBtablesById/:id", tableController.DeleteDbTables) vdbtable.PUT("/addDbTableInfo", tableController.AddDbTableInfo) vdbtable.POST("/updateDbTableStatus", tableController.UpdateDbTableStatus) + vdbtable.GET("/findAllDbTablesByCurServer", tableController.FindAllDbTablesByCurServer) } // 搴曞簱浜哄憳 鎿嶄綔 -- Gitblit v1.8.0