liuxiaolong
2019-12-04 f110d3977e7e10c76b106a86d624470229248c71
add updateChannelCount
4个文件已修改
38 ■■■■ 已修改文件
controllers/pollConfig.go 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
go.mod 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
go.sum 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
router/router.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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,"更新失败")
    }
}
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
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=
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")
    {