feat: 完善多云资产与腾讯云账单同步
- 接入 AWS、腾讯云、华为云和 Azure 区域及主机发现 - 接入腾讯云账单分页、限流与组件费用汇总 - 批量账单仅同步已支持厂商并优化云账号操作
This commit is contained in:
1 parent
74fa122319
commit
0b785da8ae
10 files changed
+821
-20
No files matched your search
@@ -37,6 +37,9 @@ func SyncDate(db *gorm.DB, billingDate string, accountID *uint) Result {
|
||||
q := db.Where("status = ?", "active")
|
||||
if accountID != nil {
|
||||
q = q.Where("id = ?", *accountID)
|
||||
} else {
|
||||
// 批量同步仅处理已接入账单 API 的厂商,避免不支持厂商造成无效失败。 // Logan.Li
|
||||
q = q.Where("provider IN ?", cloud.SupportedBillingProviders)
|
||||
}
|
||||
q.Find(&accounts)
|
||||
result.Accounts = len(accounts)
|
||||
@@ -138,4 +141,4 @@ func syncAccount(db *gorm.DB, account model.CloudAccount, billingDate string) (c
|
||||
db.Model(&account).Update("monthly_cost", monthCost)
|
||||
|
||||
return created, updated, skipped, nil
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user