Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/1036/head
zouap 3 years ago
parent
commit
6539e52f5b
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      routers/private/tool.go

+ 4
- 1
routers/private/tool.go View File

@@ -5,6 +5,7 @@
package private package private


import ( import (
"encoding/json"
"fmt" "fmt"
"net/http" "net/http"


@@ -68,7 +69,9 @@ func ShowModel(ctx *macaron.Context) {
modelResult, count, err := repo.QueryModelByParameters(repoId, 5) modelResult, count, err := repo.QueryModelByParameters(repoId, 5)
if err == nil { if err == nil {
log.Info("count=" + fmt.Sprint(count)) log.Info("count=" + fmt.Sprint(count))
ctx.JSON(200, modelResult)
modelResultjson, _ := json.Marshal(modelResult)

ctx.JSON(200, (string(modelResultjson)))
} else { } else {
ctx.JSON(500, "query error.") ctx.JSON(500, "query error.")
} }


Loading…
Cancel
Save