Browse Source

增加参数判断,如果为空直接返回error

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

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

@@ -110,6 +110,16 @@ func SaveModel(ctx *context.Context) {
label := ctx.Query("Label")
description := ctx.Query("Description")

if JobId == "" || VersionName == "" {
ctx.Error(500, fmt.Sprintf("JobId or VersionName is null."))
return
}

if name == "" || version == "" {
ctx.Error(500, fmt.Sprintf("name or version is null."))
return
}

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

if err != nil {


Loading…
Cancel
Save