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.") }