From 6ead9a5afa53dc29132eb9eb8cd6ff82b07b018a Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 23 Nov 2021 17:39:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2=E8=AE=AD?= =?UTF-8?q?=E7=BB=83=E4=BB=BB=E5=8A=A1=E7=9A=84=E6=8E=A5=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/repo/ai_model_manage.go | 18 ++++++++++++++++++ routers/routes/routes.go | 1 + 2 files changed, 19 insertions(+) diff --git a/routers/repo/ai_model_manage.go b/routers/repo/ai_model_manage.go index 556da9010..21a56288c 100644 --- a/routers/repo/ai_model_manage.go +++ b/routers/repo/ai_model_manage.go @@ -257,6 +257,24 @@ func DownloadMultiModelFile(ctx *context.Context) { } } +func QueryTrainJobList(ctx *context.Context) { + log.Info("query train job list. start.") + repoId := ctx.Query("repoId") + + VersionListTasks, VersionListCount, err := models.CloudbrainsVersionList(&models.CloudbrainsOptions{ + ListOptions: models.ListOptions{ + Page: -1, + PageSize: -1, + }, + RepoID: repoId, + Type: -1, + JobType: "", + JobID: "", + }) + + ctx.Json(200, VersionListTasks) +} + func DownloadSingleModelFile(ctx *context.Context) { log.Info("DownloadSingleModelFile start.") id := ctx.Params(":ID") diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 5a066c92f..19b8da196 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -974,6 +974,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Delete("/delete_model", repo.DeleteModel) m.Put("/modify_model", repo.ModifyModelInfo) m.Get("/show_model", reqRepoCloudBrainReader, repo.ShowModelPageInfo) + m.Get("/query_train_job", reqRepoCloudBrainReader, repo.QueryTrainJobList) m.Group("/:ID", func() { m.Get("", reqRepoCloudBrainReader, repo.ShowSingleModel) m.Get("/downloadsingle", reqRepoCloudBrainReader, repo.DownloadSingleModelFile)