| | |
| | | |
| | | import ( |
| | | "basic.com/dbapi.git" |
| | | "basic.com/valib/logger.git" |
| | | "github.com/gin-gonic/gin" |
| | | "webserver/extend/code" |
| | | "webserver/extend/util" |
| | |
| | | TargetIds []string `json:"targetIds" binging:"required"` |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 显示摄像机场景规则 |
| | | // @Description 显示摄像机场景规则 |
| | | // @Accept json |
| | |
| | | } |
| | | var api dbapi.CameraRuleApi |
| | | b,d := api.FindByCameraId(cameraId) |
| | | logger.Debug("b:", b, d) |
| | | if b { |
| | | util.ResponseFormat(c,code.Success,d) |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 保存摄像机独立规则 |
| | | // @Description 保存摄像机独立规则 |
| | | // @Accept json |
| | |
| | | } |
| | | param := util.Struct2Map(reqBody) |
| | | var api dbapi.CameraRuleApi |
| | | if api.Save(param) { |
| | | b,d := api.Save(param) |
| | | if b { |
| | | util.ResponseFormat(c,code.Success,"") |
| | | } else { |
| | | util.ResponseFormat(c,code.ComError,"") |
| | | util.ResponseFormat(c,code.ComError,d) |
| | | } |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 复制摄像机规则到选定的多个摄像机 |
| | | // @Description 复制摄像机规则到选定的多个摄像机 |
| | | // @Accept json |
| | |
| | | } |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 保存联动任务规则参数 |
| | | // @Description 保存联动任务规则参数 |
| | | // @Accept json |
| | |
| | | } |
| | | param := util.Struct2Map(saveBody) |
| | | var api dbapi.CameraRuleApi |
| | | if api.SaveLinkRulesByGroup(param) { |
| | | util.ResponseFormat(c,code.Success,saveBody) |
| | | b,d := api.SaveLinkRulesByGroup(param) |
| | | if b { |
| | | util.ResponseFormat(c,code.Success, d) |
| | | } else { |
| | | util.ResponseFormat(c,code.ComError, "") |
| | | util.ResponseFormat(c,code.ComError, d) |
| | | } |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 根据多个摄像机id查询联动任务规则设置 |
| | | // @Description 根据多个摄像机id查询联动任务规则设置 |
| | | // @Accept json |
| | |
| | | |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 修改规则组报警等级 |
| | | // @Description 修改规则组报警等级 |
| | | // @Produce json |
| | |
| | | } |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 根据分组id删除摄像机算法规则 |
| | | // @Description 根据分组id删除摄像机算法规则 |
| | | // @Produce json |
| | | // @Tags CameraTaskArgs |
| | | // @Tags 摄像机规则 |
| | | // @Param groupId path 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/rule/deleteGroup/{groupId} [get] |
| | | // @Router /data/api-v/camera/rule/deleteGroup/{groupId} [delete] |
| | | func (crc CameraRuleController) DeleteByGroup(c *gin.Context) { |
| | | groupId := c.Param("groupId") |
| | | if groupId == "" { |
| | |
| | | var api dbapi.CameraRuleApi |
| | | if api.DeleteByGroup(groupId) { |
| | | util.ResponseFormat(c, code.Success, "删除成功")//摄像机任务参数删除完了 |
| | | } else { |
| | | util.ResponseFormat(c, code.ComError, "删除失败") |
| | | } |
| | | util.ResponseFormat(c, code.ComError, "删除失败") |
| | | } |