sunty
2019-10-30 a1ef2d42d320f075c75e8cef52a879114441c103
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package controllers
 
import (
    "webserver/extend/code"
    "webserver/extend/util"
 
    "github.com/gin-gonic/gin"
)
 
type PanTiltController struct {
}
 
type PTInstruct struct {
    ChannelId string `json:"channelId"` //服务器id
    PTZType   string `json:"ptzType"`   //轮询周期
    PTZParam  int32  `json:"ptzParam"`  //延时时间
}
 
func (controller PanTiltController) Controlling(c *gin.Context) {
    var param PTInstruct
    if err := c.BindJSON(&param); err != nil {
        util.ResponseFormat(c, code.RequestParamError, "参数有误")
        return
    }
 
    b := true
    if b {
        util.ResponseFormat(c, code.Success, "")
    } else {
        util.ResponseFormat(c, code.ComError, "保存失败")
    }
}