liuxiaolong
2020-03-02 ecf240e29e0ee8046db32ba1e63cf714155c2e1a
controllers/fileAnalysis.go
@@ -143,10 +143,20 @@
}
// @Param stackId string query true "stackId"
// @Param type int query true "type"
// @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 == "" {
@@ -156,6 +166,7 @@
   typ,_ := strconv.Atoi(c.Query("type"))
   page,_ := strconv.Atoi(c.Query("page"))
   size,_ := strconv.Atoi(c.Query("size"))
   name := c.Query("name")
   if page <= 0 {
      page = 1
   }
@@ -163,10 +174,10 @@
      size = 20
   }
   var api dbapi.FileAnalysisApi
   arr,err := api.FindByStackId(stackId, typ, page, size)
   if err !=nil {
   b,d := api.FindByStackId(stackId, typ, name, page, size)
   if !b {
      util.ResponseFormat(c,code.ComError, "")
   } else {
      util.ResponseFormat(c,code.Success, arr)
      util.ResponseFormat(c,code.Success, d)
   }
}
}