liuxiaolong
2019-12-04 08ab90c17f53906b3469dfbac40d5a1de1991830
controllers/fileAnalysis.go
@@ -16,15 +16,16 @@
// @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{}{})
   }
@@ -37,7 +38,7 @@
type SortVo struct {
   Id string `json:"id" binding:"required"`
   Direct int `json:"direct" binding:"required" example:"1:向上,2:向下"`
   Direct int `json:"direct" binding:"required"`
}
type FileStatusVo struct {
@@ -45,13 +46,19 @@
   Status int `json:"status" binding:"required"`
}
const (
   File_Img_Id_Pre = "img_"
   File_Video_Id_Pre = "video_"
   File_Audio_Id_Pre = "audio_"
)
// @Security ApiKeyAuth
// @Summary 开启或暂停文件分析
// @Description 开启或暂停文件分析
// @Accept json
// @Produce json
// @Tags 本地文件
// Param reqBody body controllers.FileStatusVo true "开启暂停参数,暂停status=0,开启status=1"
// @Param reqBody body controllers.FileStatusVo true "开启暂停参数,暂停status=0,开启status=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/fileAnalysis/updateStatus [post]
@@ -77,7 +84,7 @@
// @Accept json
// @Produce json
// @Tags 本地文件
// Param reqBody body controllers.IdArrVo true "删除文件id列表"
// @Param reqBody body controllers.IdArrVo 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/fileAnalysis/delete [post]
@@ -108,7 +115,7 @@
// @Accept json
// @Produce json
// @Tags 本地文件
// Param reqBody body controllers.SortVo true "排序参数,向上direct=1,向下direct=2"
// @Param reqBody body controllers.SortVo true "排序参数,向上direct=1,向下direct=2"
// @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/sortFile [post]