liuxiaolong
2020-02-28 de48b4f9173d5e7493500a2036554c41a733eee0
controllers/fileAnalysis.go
@@ -142,3 +142,31 @@
   }
}
// @Param stackId string query true "stackId"
// @Param type int query true "type"
// @Param page query int true "当前页"
// @Param size query int true "每页数量"
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)
   }
}