| | |
| | | |
| | | } |
| | | |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 获取本地文件开关设置 |
| | | // @Description 获取本地文件开关设置 |
| | | // @Produce json |
| | | // @Tags 本地文件 |
| | | // @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" |
| | | // @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" |
| | | // @Router /data/api-v/fileSetting/show [get] |
| | | func (fsc FileAnalysisSettingController) Show(c *gin.Context) { |
| | | var api dbapi.FileAnalysisApi |
| | | setting, err := api.GetFileAnalysisSet() |
| | | if err == nil { |
| | | util.ResponseFormat(c,code.Success, setting) |
| | | util.ResponseFormat(c,code.Success, map[string]interface{}{ |
| | | "videoEnable": setting.VideoEnable, |
| | | "fileDirectory": setting.FileDirectory, |
| | | "videoChannelCount": setting.VideoChannelCount, |
| | | "imgChannelCount": setting.ImgChannelCount, |
| | | "audioChannelCount": setting.AudioChannelCount, |
| | | }) |
| | | } else { |
| | | util.ResponseFormat(c,code.ComError, setting) |
| | | } |
| | |
| | | Enable bool `json:"enable"` |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 切换本地文件分析开关 |
| | | // @Description 切换本地文件分析开关 |
| | | // @Accept json |
| | | // @Produce json |
| | | // @Tags 本地文件 |
| | | // @Param reqBody body controllers.EnableSet true "开关" |
| | | // @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" |
| | | // @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" |
| | | // @Router /data/api-v/fileSetting/changeEnable [post] |
| | | func (fsc FileAnalysisSettingController) ChangeEnable(c *gin.Context) { |
| | | var reqBody EnableSet |
| | | c.BindJSON(&reqBody) |