From 944b6f879b79b4a65b71e0e050b4736111b3c76c Mon Sep 17 00:00:00 2001 From: zouap Date: Thu, 4 Nov 2021 17:25:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/private/tool.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routers/private/tool.go b/routers/private/tool.go index c7d08430b..d751c38a7 100755 --- a/routers/private/tool.go +++ b/routers/private/tool.go @@ -5,7 +5,6 @@ package private import ( - "encoding/json" "fmt" "net/http" @@ -66,12 +65,13 @@ func DeleteModel(ctx *macaron.Context) { func ShowModel(ctx *macaron.Context) { repoId := ctx.QueryInt64("repoId") - modelResult, count, err := repo.QueryModelByParameters(repoId, 5) + page := ctx.QueryInt("page") + modelResult, count, err := repo.QueryModelByParameters(repoId, page) if err == nil { log.Info("count=" + fmt.Sprint(count)) - modelResultjson, _ := json.Marshal(modelResult) + //modelResultjson, _ := json.Marshal(modelResult) - ctx.JSON(200, (string(modelResultjson))) + ctx.JSON(200, modelResult) } else { ctx.JSON(500, "query error.") }