Browse Source

增加查询训练任务的接口。

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/1036/head
zouap 3 years ago
parent
commit
6ead9a5afa
2 changed files with 19 additions and 0 deletions
  1. +18
    -0
      routers/repo/ai_model_manage.go
  2. +1
    -0
      routers/routes/routes.go

+ 18
- 0
routers/repo/ai_model_manage.go View File

@@ -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")


+ 1
- 0
routers/routes/routes.go View File

@@ -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)


Loading…
Cancel
Save