chore: 统一本地服务器与远程仓库源码
- 合并 main 与 master 历史并以服务器结构为基线 - 保留迁移、数据保留、AWS 账单与部署安全能力 - 建立 SDD 规格和 CI 验证闭环
This commit is contained in:
commit
fd60361d93
460 files changed
+37492
-23871
No files matched your search
+40
-10
@@ -22,9 +22,21 @@ type CloudBilling struct {
|
||||
}
|
||||
|
||||
func (CloudBilling) TableName() string {
|
||||
return "asset_cloud_billings"
|
||||
return "asset_cloud_billing_records"
|
||||
}
|
||||
|
||||
// BillingSettings 保存轻量云账单换算设置。 // Logan.Li
|
||||
type BillingSettings struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
USDCNYRate float64 `gorm:"type:decimal(12,6);default:7.2" json:"usd_cny_rate"`
|
||||
UpdatedBy string `gorm:"size:128" json:"updated_by"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// TableName 指定云账单设置表名。 // Logan.Li
|
||||
func (BillingSettings) TableName() string { return "asset_cloud_billing_settings" }
|
||||
|
||||
// BillingAlertRule 账单预警规则
|
||||
type BillingAlertRule struct {
|
||||
ID uint `gorm:"primarykey" json:"id"`
|
||||
@@ -41,19 +53,24 @@ type BillingAlertRule struct {
|
||||
}
|
||||
|
||||
func (BillingAlertRule) TableName() string {
|
||||
return "monitor_billing_alert_rules"
|
||||
return "asset_cloud_billing_alert_rules"
|
||||
}
|
||||
|
||||
// BillingStats 账单统计
|
||||
type BillingStats struct {
|
||||
Currency string `json:"currency"`
|
||||
TodayCost float64 `json:"today_cost"`
|
||||
MonthCost float64 `json:"month_cost"`
|
||||
YearCost float64 `json:"year_cost"`
|
||||
YesterdayCost float64 `json:"yesterday_cost"`
|
||||
MonthTrend []DailyCost `json:"month_trend"`
|
||||
ProviderDist []ProviderCost `json:"provider_dist"`
|
||||
Alerts []BillingAlert `json:"alerts"`
|
||||
TodayCost float64 `json:"today_cost"`
|
||||
MonthCost float64 `json:"month_cost"`
|
||||
YearCost float64 `json:"year_cost"`
|
||||
YesterdayCost float64 `json:"yesterday_cost"`
|
||||
MonthTrend []DailyCost `json:"month_trend"`
|
||||
ProviderDist []ProviderCost `json:"provider_dist"`
|
||||
ProviderTrend []ProviderDailyCost `json:"provider_trend"`
|
||||
TopServices []ServiceCost `json:"top_services"`
|
||||
Alerts []BillingAlert `json:"alerts"`
|
||||
Currency string `json:"currency"`
|
||||
ExchangeRates map[string]float64 `json:"exchange_rates"`
|
||||
RateSource string `json:"rate_source"`
|
||||
DataThrough string `json:"data_through"`
|
||||
}
|
||||
|
||||
// DailyCost 每日成本
|
||||
@@ -69,6 +86,19 @@ type ProviderCost struct {
|
||||
Percent float64 `json:"percent"`
|
||||
}
|
||||
|
||||
// ProviderDailyCost 表示指定云厂商按报告币种折算后的日费用。 // Logan.Li
|
||||
type ProviderDailyCost struct {
|
||||
Provider string `json:"provider"`
|
||||
Date string `json:"date"`
|
||||
Cost float64 `json:"cost"`
|
||||
}
|
||||
|
||||
// ServiceCost 表示本月服务费用排行。 // Logan.Li
|
||||
type ServiceCost struct {
|
||||
Service string `json:"service"`
|
||||
Cost float64 `json:"cost"`
|
||||
}
|
||||
|
||||
// BillingAlert 账单预警
|
||||
type BillingAlert struct {
|
||||
RuleID uint `json:"rule_id"`
|
||||
|
||||
Reference in new issue
Block a user