|
|
@@ -0,0 +1,40 @@ |
|
|
|
// Copyright 2016 The Gogs Authors. All rights reserved. |
|
|
|
// Copyright 2018 The Gitea Authors. All rights reserved. |
|
|
|
// Use of this source code is governed by a MIT-style |
|
|
|
// license that can be found in the LICENSE file. |
|
|
|
|
|
|
|
package repo |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/modelarts" |
|
|
|
) |
|
|
|
|
|
|
|
func GetModelArtsTask(ctx *context.APIContext) { |
|
|
|
var ( |
|
|
|
err error |
|
|
|
) |
|
|
|
|
|
|
|
jobID := ctx.Params(":jobid") |
|
|
|
repoID := ctx.Repo.Repository.ID |
|
|
|
_, err = models.GetRepoCloudBrainByJobID(repoID, jobID) |
|
|
|
if err != nil { |
|
|
|
ctx.NotFound(err) |
|
|
|
return |
|
|
|
} |
|
|
|
_, err = modelarts.GetJob(jobID) |
|
|
|
if err != nil { |
|
|
|
ctx.NotFound(err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//ctx.JSON(http.StatusOK, map[string]interface{}{ |
|
|
|
// "JobID": result.Config.JobID, |
|
|
|
// "JobStatus": result.JobStatus.State, |
|
|
|
// "SubState": result.JobStatus.SubState, |
|
|
|
// "CreatedTime": time.Unix(result.JobStatus.CreatedTime/1000, 0).Format("2006-01-02 15:04:05"), |
|
|
|
// "CompletedTime": time.Unix(result.JobStatus.CompletedTime/1000, 0).Format("2006-01-02 15:04:05"), |
|
|
|
//}) |
|
|
|
|
|
|
|
} |