feat(models): 模型目录与计费 - 按展示名分组并隔离管理员积分成本

This commit is contained in:
ddCat committed 2026-09-19 09:54:27 +08:00
1 parent 5ad05efb58
commit 237f2e2a6e
49 files changed
+802 -276

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
package model
// CreditCostPricing 仅供管理员配置和内部核算。持有者必须使用 json:"-",
// 管理端通过专用响应投影公开,禁止随用户目录、报价或账单序列化。
type CreditCostPricing struct {
Configured bool `json:"configured" gorm:"not null;default:false"`
UnitPriceMicrocredits int64 `json:"unitPriceMicrocredits" gorm:"not null;default:0"`
InputTokenPriceMicrocredits int64 `json:"inputTokenPriceMicrocredits" gorm:"not null;default:0"`
OutputTokenPriceMicrocredits int64 `json:"outputTokenPriceMicrocredits" gorm:"not null;default:0"`
CachedTokenPriceMicrocredits int64 `json:"cachedTokenPriceMicrocredits" gorm:"not null;default:0"`
}
// BillingCostSnapshot 独立于销售价格,切换供应线路时始终更新为实际执行线路的成本。
type BillingCostSnapshot struct {
CostPricing CreditCostPricing `json:"-" gorm:"embedded;embeddedPrefix:cost_"`
CostBillingMode string `json:"-" gorm:"size:32;not null;default:''"`
CostQuantity int64 `json:"-" gorm:"not null;default:0"`
CostVideoFormulaTokens int64 `json:"-" gorm:"not null;default:0"`
}