Files
aiops/backend/cloud/billing.go
T
Logan.Li dd3770a66c fix: 恢复腾讯云账单同步并完善成本预测
- 接入腾讯云单日账单、全局限频和指数退避

- 修正月末费用预测并增加账期提示和费用归因

- 补充腾讯云限频及账单归因回归测试
2026-07-29 05:44:40 +08:00

32 lines
999 B
Go

package cloud
// CloudBillingRecord 云账单同步记录(跨平台统一结构) // Logan.Li
type CloudBillingRecord struct {
BillingDate string `json:"billing_date"`
Provider string `json:"provider"`
Cost float64 `json:"cost"`
Currency string `json:"currency"`
Service string `json:"service"`
Region string `json:"region"`
Description string `json:"description"`
}
// BillingFetcher 云账单拉取接口
type BillingFetcher interface {
FetchDailyBill(billingDate string) ([]CloudBillingRecord, error)
}
// SupportedBillingProviders 已接入账单 API 的云厂商列表。 // Logan.Li
var SupportedBillingProviders = []string{"aliyun", "tencent"}
// NewBillingFetcher 根据云厂商创建账单拉取器
func NewBillingFetcher(provider, accessKey, secretKey string) BillingFetcher {
switch provider {
case "aliyun":
return NewAliyunProvider(accessKey, secretKey)
case "tencent":
return NewTencentProvider(accessKey, secretKey)
}
return nil
}