refactor platform menus and entity statuses

This commit is contained in:
david
2026-07-29 13:18:52 +08:00
parent 978dc446d9
commit afd9dbdeb5
48 changed files with 510 additions and 421 deletions

View File

@@ -44,7 +44,7 @@ func CreateGasAccount(ctx *gin.Context) {
infra.Response.Error(ctx, err)
return
}
account := models.GasAccount{Entity: common.NewEntity("enabled"), GasBasicID: gasBasicID, Username: request.Username, DisplayName: request.DisplayName, PasswordHash: hash, RoleCode: request.RoleCode}
account := models.GasAccount{Entity: common.NewEntity(common.StatusEnable), GasBasicID: gasBasicID, Username: request.Username, DisplayName: request.DisplayName, PasswordHash: hash, RoleCode: request.RoleCode}
if err := impl.DBService.Create(&account).Error; err != nil {
infra.Response.Error(ctx, err)
return

View File

@@ -22,7 +22,7 @@ func CreateGasBasic(ctx *gin.Context) {
infra.Response.Error(ctx, errcode.ErrInvalidArgument)
return
}
request.Entity = common.NewEntity("draft")
request.Entity = common.NewEntity(common.StatusDraft)
if err := impl.DBService.Create(&request).Error; err != nil {
infra.Response.Error(ctx, err)
return