From ecf240e29e0ee8046db32ba1e63cf714155c2e1a Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期一, 02 三月 2020 17:42:53 +0800 Subject: [PATCH] fix result --- controllers/fileAnalysis.go | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/controllers/fileAnalysis.go b/controllers/fileAnalysis.go index def3f4b..5c36331 100644 --- a/controllers/fileAnalysis.go +++ b/controllers/fileAnalysis.go @@ -149,8 +149,9 @@ // @Accept json // @Produce json // @Tags 鏈湴鏂囦欢 -// @Param stackId string query true "stackId" -// @Param type int query true "type" +// @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:""}" @@ -165,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 } @@ -172,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) } -} \ No newline at end of file +} -- Gitblit v1.8.0