mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): billing resource create time (#24142)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user