From f110d3977e7e10c76b106a86d624470229248c71 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期三, 04 十二月 2019 13:46:15 +0800 Subject: [PATCH] add updateChannelCount --- go.sum | 8 ++++---- controllers/pollConfig.go | 25 +++++++++++++++++++++++++ go.mod | 4 ++-- router/router.go | 1 + 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/controllers/pollConfig.go b/controllers/pollConfig.go index 9362d88..8b4c52d 100644 --- a/controllers/pollConfig.go +++ b/controllers/pollConfig.go @@ -113,3 +113,28 @@ util.ResponseFormat(c, code.ComError, "淇敼澶辫触") } } + +type ChannelCountSet struct { + PollChannelCount int `json:"pollChannelCount"` + FileChannelCount int `json:"fileChannelCount"` +} + +// @Summary 璁剧疆杞绠楀姏鍜屾湰鍦扮畻鍔涚殑鏁伴噺 +// @Description 璁剧疆杞绠楀姏鍜屾湰鍦扮畻鍔涚殑鏁伴噺 +// @Accept json +// @Produce json +// @Tags 杞閰嶇疆 +// @Param argBody body controllers.ChannelCountSet 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/pollConfig/updateChannelCount [post] +func (controller PollConfigController) UpdateChannelCount(c *gin.Context) { + var argBody ChannelCountSet + c.BindJSON(&argBody) + var api dbapi.SysSetApi + if api.UpdateChannelCount(argBody.PollChannelCount, argBody.FileChannelCount) { + util.ResponseFormat(c,code.UpdateSuccess,"鏇存柊鎴愬姛") + } else { + util.ResponseFormat(c,code.UpdateFail,"鏇存柊澶辫触") + } +} \ No newline at end of file diff --git a/go.mod b/go.mod index febb60c..1c6fecf 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,12 @@ go 1.12 require ( - basic.com/dbapi.git v0.0.0-20191203063234-03f4e6e0222e // indirect + basic.com/dbapi.git v0.0.0-20191204054247-0213e81df2bc // indirect basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb // indirect basic.com/gb28181api.git v0.0.0-20191028082253-472438a8407b // indirect basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48 // indirect basic.com/pubsub/esutil.git v0.0.0-20191120125514-865efa73a9ae // indirect - basic.com/pubsub/protomsg.git v0.0.0-20191202120753-f20294c1ff90 // indirect + basic.com/pubsub/protomsg.git v0.0.0-20191203090006-ecdaf2f00a5d // indirect basic.com/valib/capture.git v0.0.0-20191126081138-bf954c0fa627 // indirect basic.com/valib/deliver.git v0.0.0-20190531095353-25d8c3b20051 basic.com/valib/godraw.git v0.0.0-20191122082247-26e9987cd183 // indirect diff --git a/go.sum b/go.sum index 4f00bd7..a4820fb 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -basic.com/dbapi.git v0.0.0-20191203063234-03f4e6e0222e h1:DyIvWq/zeq+y82NFVWm5xnpGxSs65/8RZWGo2fpVnGo= -basic.com/dbapi.git v0.0.0-20191203063234-03f4e6e0222e/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q= +basic.com/dbapi.git v0.0.0-20191204054247-0213e81df2bc h1:tt0UHaoU7MSsLwZDkHa+YXa798gxHysASIJl35aoWFg= +basic.com/dbapi.git v0.0.0-20191204054247-0213e81df2bc/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q= basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb h1:fM6DojeInFSCFO+wkba1jtyPiSDqw0jYKi4Tk+e+ka4= basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb/go.mod h1:FTryK8BsVLfUplx8a3+l8hJWub6VbAWZCUH7sPRZaso= basic.com/gb28181api.git v0.0.0-20191028082253-472438a8407b h1:Qh7x2PY3HA9B404Llq+olY5/YlGYrM58bpOHa2CGcro= @@ -8,8 +8,8 @@ basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48/go.mod h1:gHLJZz2ee1cGL0X0ae69fs56bAxkDgEQwDhhXZJNUcY= basic.com/pubsub/esutil.git v0.0.0-20191120125514-865efa73a9ae h1:/j1dIDLxzEp51N+ZHZIq1xeYVK9zz8epWEAfw01uWe8= basic.com/pubsub/esutil.git v0.0.0-20191120125514-865efa73a9ae/go.mod h1:yIvppFPFGC61DOdm71ujnsxZBMFUu2yKjr5O43bMWCw= -basic.com/pubsub/protomsg.git v0.0.0-20191202120753-f20294c1ff90 h1:bQiuJTp4+7KvCfDmVQPDUwk3n/sqHD6/YyO/akh94Ek= -basic.com/pubsub/protomsg.git v0.0.0-20191202120753-f20294c1ff90/go.mod h1:un5NV5VWQoblVLZfx1Rt5vyLgwR0jI92d3VJhfrJhWU= +basic.com/pubsub/protomsg.git v0.0.0-20191203090006-ecdaf2f00a5d h1:EnBuOjqgcOug/tnjAOgmtGLmA7kotxVt4ZMcaHkz1L0= +basic.com/pubsub/protomsg.git v0.0.0-20191203090006-ecdaf2f00a5d/go.mod h1:un5NV5VWQoblVLZfx1Rt5vyLgwR0jI92d3VJhfrJhWU= basic.com/valib/capture.git v0.0.0-20191126081138-bf954c0fa627 h1:26J3wU05U/v72SvUvtFc6Ymgvlill9SXbRn/cMGE5k0= basic.com/valib/capture.git v0.0.0-20191126081138-bf954c0fa627/go.mod h1:y+h7VUnoSQ3jOtf2K3twXNA8fYDfyUsifSswcyKLgNw= basic.com/valib/deliver.git v0.0.0-20190531095353-25d8c3b20051/go.mod h1:bkYiTUGzckyNOjAgn9rB/DOjFzwoSHJlruuWQ6hu6IY= diff --git a/router/router.go b/router/router.go index 6012c52..253b880 100644 --- a/router/router.go +++ b/router/router.go @@ -276,6 +276,7 @@ pollCApi.POST("/savePollDelay", pollConfigController.SavePollDelay) pollCApi.GET("/getPollConfig", pollConfigController.GetPollConfig) pollCApi.POST("/updateEnable", pollConfigController.UpdateEnable) + pollCApi.POST("/updateChannelCount", pollConfigController.UpdateChannelCount) } clusterApi := r.Group(urlPrefix + "/cluster") { -- Gitblit v1.8.0