| | |
| | | RunEnable bool `json:"run_enable"` //控制实时处理或轮询处理的开关 |
| | | RunType int `json:"run_type"` //处理类型:0:轮询,1:实时 |
| | | RunServerId string `json:"run_server_id"` //当前正在处理的分析服务器id |
| | | |
| | | Sensors []SensorVo `json:"sensors"` //传感器列表 |
| | | } |
| | | |
| | | type SensorVo struct { |
| | | Id string `json:"id"` |
| | | Type int `json:"type"` |
| | | Ip string `json:"ip"` |
| | | Port int `json:"port"` |
| | | Username string `json:"username"` |
| | | Password string `json:"password"` |
| | | Threshold int `json:"threshold"` |
| | | Enable bool `json:"enable"` |
| | | DevId string `json:"devId"` |
| | | } |
| | | |
| | | // @Summary 添加摄像机 |
| | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 将摄像机挂到指定的目录树下 |
| | | // @Description 将摄像机挂到指定的目录树下 |
| | | // @Accept x-www-form-urlencoded |
| | | // @Produce json |
| | | // @Tags camera |
| | | // @Param cameraId path string true "摄像机id" |
| | | // @Param areaId path string true "目录区域id" |
| | | // @Param cameraId formData string true "摄像机id" |
| | | // @Param areaId formData string true "目录区域id" |
| | | // @Success 200 {string} json "{"code":200, success:true, msg:"请求处理成功", data:""}" |
| | | // @Failure 500 {string} json "{"code":500, success:false, msg:"",data:"错误信息内容"}" |
| | | // @Router /data/api-v/camera/cameraAreaAdd [get] |
| | | func (ac CameraController) CameraAreaAdd(c *gin.Context) { |
| | | cameraId := c.Param("cameraId") |
| | | areaId := c.Param("areaId") |
| | | fmt.Println(cameraId) |
| | | fmt.Println(areaId) |
| | | // @Router /data/api-v/camera/updateCameraArea [post] |
| | | func (ac CameraController) UpdateCameraArea(c *gin.Context) { |
| | | cameraId := c.PostForm("cameraId") |
| | | areaId := c.PostForm("areaId") |
| | | if cameraId == "" || areaId == "" { |
| | | util.ResponseFormat(c, code.RequestParamError, "参数有误") |
| | | return |
| | | } |
| | | var api dbapi.CameraApi |
| | | if api.UpdateCameraArea(cameraId, areaId) { |
| | | util.ResponseFormat(c,code.Success,"更新成功") |
| | | } else { |
| | | util.ResponseFormat(c,code.ComError,"") |
| | | } |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |