| @@ -5,7 +5,6 @@ | |||||
| package private | package private | ||||
| import ( | import ( | ||||
| "encoding/json" | |||||
| "fmt" | "fmt" | ||||
| "net/http" | "net/http" | ||||
| @@ -66,12 +65,13 @@ func DeleteModel(ctx *macaron.Context) { | |||||
| func ShowModel(ctx *macaron.Context) { | func ShowModel(ctx *macaron.Context) { | ||||
| repoId := ctx.QueryInt64("repoId") | 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 { | if err == nil { | ||||
| log.Info("count=" + fmt.Sprint(count)) | log.Info("count=" + fmt.Sprint(count)) | ||||
| modelResultjson, _ := json.Marshal(modelResult) | |||||
| //modelResultjson, _ := json.Marshal(modelResult) | |||||
| ctx.JSON(200, (string(modelResultjson))) | |||||
| ctx.JSON(200, modelResult) | |||||
| } else { | } else { | ||||
| ctx.JSON(500, "query error.") | ctx.JSON(500, "query error.") | ||||
| } | } | ||||