Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1^2
zouap 3 years ago
parent
commit
e3e228f8a6
2 changed files with 4 additions and 3 deletions
  1. +1
    -2
      models/ai_model_manage.go
  2. +3
    -1
      routers/private/tool.go

+ 1
- 2
models/ai_model_manage.go View File

@@ -127,8 +127,7 @@ func QueryModel(opts *AiModelQueryOptions) ([]*AiModelManage, int64, error) {

sess.OrderBy("ai_model_manage.created_unix DESC")
aiModelManages := make([]*AiModelManage, 0, setting.UI.IssuePagingNum)
if err := sess.Table(&AiModelManage{}).Where(cond).
Join("left", "`user`", "ai_model_manage.user_id = `user`.id").
if err := sess.Table("ai_model_manage").Where(cond).
Find(&aiModelManages); err != nil {
return nil, 0, fmt.Errorf("Find: %v", err)
}


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

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

import (
"fmt"
"net/http"

"code.gitea.io/gitea/models"
@@ -64,8 +65,9 @@ func DeleteModel(ctx *macaron.Context) {

func ShowModel(ctx *macaron.Context) {
repoId := ctx.QueryInt64("repoId")
modelResult, _, err := repo.QueryModelByParameters(repoId, 5)
modelResult, count, err := repo.QueryModelByParameters(repoId, 5)
if err == nil {
log.Info("count=" + fmt.Sprint(count))
ctx.JSON(200, modelResult)
} else {
ctx.JSON(500, "query error.")


Loading…
Cancel
Save