更新若干

This commit is contained in:
hero920103 committed 2026-11-17 17:16:02 +08:00
1 parent 54c90072fb
commit 5682069553
59 files changed
+3813 -1617

No files matched your search

+7
View File
@@ -38,6 +38,8 @@ type tenantDTO struct {
UserQuota int `json:"user_quota"`
UserUsed int `json:"user_used"`
StorageQuotaMB int `json:"storage_quota_mb"`
StorageUsedMB float64 `json:"storage_used_mb"`
StoragePercent float64 `json:"storage_percent"`
Remark string `json:"remark"`
CreateTime *time.Time `json:"create_time,omitempty"`
UpdateTime *time.Time `json:"update_time,omitempty"`
@@ -164,6 +166,11 @@ func (c *PlatformTenantController) GetTenant() {
dto := toTenantDTO(t)
dto.PackageName = packageNames[t.PackageID]
dto.UserUsed = userCounts[t.ID]
if info, ierr := services.GetTenantStorageInfo(t.ID); ierr == nil && info != nil {
dto.StorageQuotaMB = info.QuotaMB
dto.StorageUsedMB = math.Round(float64(info.UsedBytes)/float64(1024*1024)*10) / 10
dto.StoragePercent = info.UsedPercent
}
list = append(list, dto)
}