liuxiaolong
2019-08-22 68fc51cb635fecf12cad58deab88c3b5e0afc0ad
controllers/pollConfig.go
@@ -18,6 +18,7 @@
   Enable     bool   `json:"enable"`      //是否启用轮询
}
/*
// @Summary 保存轮询周期
// @Description 保存轮询周期
// @Produce json
@@ -26,6 +27,7 @@
// @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/savePollPeriod [post]
*/
func (controller PollConfigController) SavePollPeriod(c *gin.Context) {
   periodStr := c.PostForm("period")
   period, err := strconv.Atoi(periodStr)
@@ -42,6 +44,7 @@
   }
}
/*
// @Summary 保存轮询延时
// @Description 保存轮询延时
// @Produce json
@@ -50,6 +53,7 @@
// @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/savePollDelay [post]
*/
func (controller PollConfigController) SavePollDelay(c *gin.Context) {
   delayStr := c.PostForm("delay")
   delay, err := strconv.Atoi(delayStr)
@@ -66,6 +70,7 @@
   }
}
/*
// @Summary 获取本机轮询配置
// @Description 获取本机轮询配置
// @Produce json
@@ -73,6 +78,7 @@
// @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/getPollConfig [get]
*/
func (controller PollConfigController) GetPollConfig(c *gin.Context) {
   var api dbapi.SysSetApi
   b, data := api.GetPollConfig()
@@ -87,6 +93,7 @@
   Enable bool `json:"enable"`
}
/*
// @Summary 切换轮询开关
// @Description 切换轮询开关
// @Produce json
@@ -95,6 +102,7 @@
// @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/updateEnable [post]
*/
func (controller PollConfigController) UpdateEnable(c *gin.Context) {
   var argBody PollEnableVo
   if err := c.BindJSON(&argBody); err != nil {