| | |
| | | // @Description 获取本地文件列表 |
| | | // @Produce json |
| | | // @Tags 本地文件 |
| | | // @Param fileName query string false "根据文件名称查询" |
| | | // @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" |
| | | // @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" |
| | | // @Router /data/api-v/fileAnalysis/findAllFile [get] |
| | | func (fac FileAnalysisController) FindAllFile(c *gin.Context) { |
| | | fileName := c.Query("fileName") |
| | | var api dbapi.FileAnalysisApi |
| | | arr, _ := api.FindAllFile(fileName) |
| | | if arr !=nil && len(arr) >0 { |
| | | util.ResponseFormat(c,code.Success,arr) |
| | | b, d := api.FindAllFile(fileName) |
| | | if b { |
| | | util.ResponseFormat(c,code.Success, d) |
| | | } else { |
| | | util.ResponseFormat(c,code.Success,[]interface{}{}) |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | // @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() |
| | |
| | | Enable bool `json:"enable"` |
| | | } |
| | | |
| | | // @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) |
| | |
| | | go 1.12 |
| | | |
| | | require ( |
| | | basic.com/dbapi.git v0.0.0-20191202091445-8ddb48697708 // indirect |
| | | basic.com/dbapi.git v0.0.0-20191203063234-03f4e6e0222e // indirect |
| | | basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb // indirect |
| | | basic.com/gb28181api.git v0.0.0-20191028082253-472438a8407b // indirect |
| | | basic.com/pubsub/cache.git v0.0.0-20190718093725-6a413e1d7d48 // indirect |
| | |
| | | basic.com/dbapi.git v0.0.0-20191202091445-8ddb48697708 h1:8lk1xOxDhlOftb7xaFSaB554zP97Y2m2oW4dJrHZnNM= |
| | | basic.com/dbapi.git v0.0.0-20191202091445-8ddb48697708/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q= |
| | | basic.com/dbapi.git v0.0.0-20191203063234-03f4e6e0222e h1:DyIvWq/zeq+y82NFVWm5xnpGxSs65/8RZWGo2fpVnGo= |
| | | basic.com/dbapi.git v0.0.0-20191203063234-03f4e6e0222e/go.mod h1:eDXPnxaz6jZPDvBSk7ya7oSASWPCuUEgRTJCjsfKt/Q= |
| | | basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb h1:fM6DojeInFSCFO+wkba1jtyPiSDqw0jYKi4Tk+e+ka4= |
| | | basic.com/fileServer/WeedFSClient.git v0.0.0-20190919054037-0182b6c3f5cb/go.mod h1:FTryK8BsVLfUplx8a3+l8hJWub6VbAWZCUH7sPRZaso= |
| | | basic.com/gb28181api.git v0.0.0-20191028082253-472438a8407b h1:Qh7x2PY3HA9B404Llq+olY5/YlGYrM58bpOHa2CGcro= |