| | |
| | | import ( |
| | | "basic.com/dbapi.git" |
| | | "github.com/gin-gonic/gin" |
| | | "strconv" |
| | | "webserver/extend/code" |
| | | "webserver/extend/util" |
| | | ) |
| | |
| | | } |
| | | } |
| | | |
| | | // @Summary 根据分组id切换布防或撤防 |
| | | // @Description 根据分组id切换布防或撤防 |
| | | // @Produce json |
| | | // @Tags CameraTaskArgs |
| | | // @Param groupId query string true "任务算法参数分组id" |
| | | // @Param defence_state query int true "布防状态,0:撤防,1:布防" |
| | | // @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" |
| | | // @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" |
| | | // @Router /data/api-v/cameraTaskArgs/updateDefenceStateByGroup [post] |
| | | func (controller CameraTaskArgsController) UpdateDefenceStateByGroup(c *gin.Context){ |
| | | groupId := c.PostForm("groupId") |
| | | str := c.PostForm("defence_state") |
| | | defenceState, err := strconv.ParseBool(str) |
| | | if groupId =="" || err !=nil{ |
| | | util.ResponseFormat(c, code.RequestParamError, "参数有误") |
| | | return |
| | | } |
| | | var api dbapi.CameraTaskArgsApi |
| | | if b,data := api.UpdateDefenceStateByGroup(groupId,defenceState);b{ |
| | | util.ResponseFormat(c,code.UpdateSuccess,data) |
| | | } else { |
| | | util.ResponseFormat(c,code.ComError,data) |
| | | } |
| | | } |
| | | |
| | | // @SUmmary 根据分组id删除摄像机算法规则 |
| | | // @Description 根据分组id删除摄像机算法规则 |
| | | // @Produce json |