| | |
| | | } |
| | | |
| | | } |
| | | |
| | | // @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) |
| | | } |
| | | } |
| | |
| | | fileAnalyApi.POST("/updateStatus", fileAnalysisC.UpdateStatus) |
| | | fileAnalyApi.POST("/delete", fileAnalysisC.Delete) |
| | | fileAnalyApi.POST("/sortFile", fileAnalysisC.SortFile) |
| | | fileAnalyApi.GET("/findByStackId", fileAnalysisC.FindByStackId) |
| | | } |
| | | fileSettingApi := r.Group(urlPrefix + "/fileSetting") |
| | | { |