| | |
| | | // @Param fileName query string false "根据文件名称查询" |
| | | // @Param page query int true "当前页" |
| | | // @Param size query int true "每页数量" |
| | | // @Param type query int true "0:处理完成,1:处理中,2:未配规则,3:处理失败" |
| | | // @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] |
| | |
| | | fileName := c.Query("fileName") |
| | | page,_ := strconv.Atoi(c.Query("page")) |
| | | size,_ := strconv.Atoi(c.Query("size")) |
| | | fType,_ := strconv.Atoi(c.Query("type")) |
| | | var api dbapi.FileAnalysisApi |
| | | b, d := api.FindAllFile(fileName, page, size) |
| | | b, d := api.FindAllFile(fileName, fType, page, size) |
| | | if b { |
| | | util.ResponseFormat(c,code.Success, d) |
| | | } else { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 按数据栈id查找文件 |
| | | // @Description 按数据栈id查找文件 |
| | | // @Accept json |
| | | // @Produce json |
| | | // @Tags 本地文件 |
| | | // @Param stackId query string true "stackId" |
| | | // @Param type query int true "type" |
| | | // @Param name query string "搜索条件" |
| | | // @Param page query int true "当前页" |
| | | // @Param size query int 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/fileAnalysis/findByStackId [get] |
| | | func (fac FileAnalysisController) FindByStackId(c *gin.Context) { |
| | | stackId := c.Query("stackId") |
| | | if stackId == "" { |
| | | util.ResponseFormat(c,code.RequestParamError, "") |
| | | return |
| | | } |
| | | typ,_ := strconv.Atoi(c.Query("type")) |
| | | page,_ := strconv.Atoi(c.Query("page")) |
| | | size,_ := strconv.Atoi(c.Query("size")) |
| | | if page <= 0 { |
| | | page = 1 |
| | | } |
| | | if size <= 0 { |
| | | size = 20 |
| | | } |
| | | var api dbapi.FileAnalysisApi |
| | | arr,err := api.FindByStackId(stackId, typ, page, size) |
| | | if err !=nil { |
| | | util.ResponseFormat(c,code.ComError, "") |
| | | } else { |
| | | util.ResponseFormat(c,code.Success, arr) |
| | | } |
| | | } |