Browse Source

提交代码。

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

+ 1
- 0
models/ai_model_manage.go View File

@@ -30,6 +30,7 @@ type AiModelManage struct {
CodeBranch string `xorm:"varchar(400) NULL"`
CodeCommitID string `xorm:"NULL"`
UserId int64 `xorm:"NOT NULL"`
UserName string `xorm:"NULL"`
TrainTaskInfo string `xorm:"text NULL"`
CreatedUnix timeutil.TimeStamp `xorm:"created"`
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`


+ 3
- 2
routers/repo/ai_model_manage.go View File

@@ -25,7 +25,7 @@ const (
MODEL_NOT_LATEST = 0
)

func saveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, userId int64) error {
func saveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, userId int64, userName string) error {
aiTask, err := models.GetCloudbrainByJobIDAndVersionName(jobId, versionName)
//aiTask, err := models.GetCloudbrainByJobID(jobId)
if err != nil {
@@ -82,6 +82,7 @@ func saveModelByParameters(jobId string, versionName string, name string, versio
AttachmentId: aiTask.Uuid,
RepoId: aiTask.RepoID,
UserId: userId,
UserName: userName,
CodeBranch: aiTask.BranchName,
CodeCommitID: aiTask.CommitID,
Engine: aiTask.EngineID,
@@ -122,7 +123,7 @@ func SaveModel(ctx *context.Context) {
return
}

err := saveModelByParameters(JobId, VersionName, name, version, label, description, ctx.User.ID)
err := saveModelByParameters(JobId, VersionName, name, version, label, description, ctx.User.ID, ctx.User.Name)

if err != nil {
log.Info("save model error." + err.Error())


Loading…
Cancel
Save