From de48b4f9173d5e7493500a2036554c41a733eee0 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期五, 28 二月 2020 19:10:49 +0800
Subject: [PATCH] add findByStackId
---
controllers/fileAnalysis.go | 28 ++++++++++++++++++++++++++++
router/router.go | 1 +
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/controllers/fileAnalysis.go b/controllers/fileAnalysis.go
index 863601c..83a83eb 100644
--- a/controllers/fileAnalysis.go
+++ b/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)
+ }
+}
\ No newline at end of file
diff --git a/router/router.go b/router/router.go
index 0dfc2af..528e738 100644
--- a/router/router.go
+++ b/router/router.go
@@ -324,6 +324,7 @@
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")
{
--
Gitblit v1.8.0