fix(region): billing resource create time (#24142)

This commit is contained in:
屈轩
2026-01-28 19:59:57 +08:00
committed by GitHub
parent c816e075e4
commit a2f631d749
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -48,6 +48,10 @@ type SResourceBaseManager struct {
SModelBaseManager
}
func (model *SResourceBase) GetCreatedAt() time.Time {
return model.CreatedAt
}
func NewResourceBaseManager(dt interface{}, tableName string, keyword string, keywordPlural string) SResourceBaseManager {
return SResourceBaseManager{NewModelBaseManager(dt, tableName, keyword, keywordPlural)}
}
@@ -61,6 +61,7 @@ type IBillingModel interface {
GetExpiredAt() time.Time
GetReleaseAt() time.Time
GetAutoRenew() bool
GetCreatedAt() time.Time
SetReleaseAt(releaseAt time.Time)
SetExpiredAt(expireAt time.Time)
SetBillingCycle(billingCycle string)
@@ -208,6 +209,7 @@ func (bm *SBillingResourceCheckManager) Create(ctx context.Context, res IBilling
bc.ProjectId = owner.GetProjectId()
bc.DomainId = owner.GetDomainId()
}
bc.CreatedAt = res.GetCreatedAt()
bc.Status = res.GetStatus()
bc.SetModelManager(bm, bc)
return bm.TableSpec().InsertOrUpdate(ctx, bc)