feat(admin): upgrade admin console UI widgets, add plan & status management, and redesign system status dashboard
This commit is contained in:
@@ -386,3 +386,20 @@ func (p *Postgres) ResolveBillingTenantID(ctx context.Context, userID, activeTen
|
||||
}
|
||||
return activeTenantID
|
||||
}
|
||||
|
||||
// SetTenantPlan 更改租户方案等级。
|
||||
func (p *Postgres) SetTenantPlan(ctx context.Context, tenantID string, plan string) error {
|
||||
if p.db == nil {
|
||||
return errStoreDisabled
|
||||
}
|
||||
return p.db.WithContext(ctx).Model(&Tenant{}).Where("id = ?", tenantID).Update("plan", plan).Error
|
||||
}
|
||||
|
||||
// SetTenantStatus 更改租户状态(active / suspended)。
|
||||
func (p *Postgres) SetTenantStatus(ctx context.Context, tenantID string, status string) error {
|
||||
if p.db == nil {
|
||||
return errStoreDisabled
|
||||
}
|
||||
return p.db.WithContext(ctx).Model(&Tenant{}).Where("id = ?", tenantID).Update("status", status).Error
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user