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

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

View File

@@ -0,0 +1,22 @@
package handler
import "infinite-canvas/backend/internal/model"
// 成本字段只在已通过 service 管理员校验的模型编辑接口中显式投影。
type adminChannelModelPriceTier struct {
model.ChannelModelPriceTier
CostPricing model.CreditCostPricing `json:"costPricing"`
}
type adminChannelModelResponse struct {
model.ChannelModel
PriceTiers []adminChannelModelPriceTier `json:"priceTiers"`
}
func adminChannelModel(item model.ChannelModel) adminChannelModelResponse {
tiers := make([]adminChannelModelPriceTier, 0, len(item.PriceTiers))
for _, tier := range item.PriceTiers {
tiers = append(tiers, adminChannelModelPriceTier{ChannelModelPriceTier: tier, CostPricing: tier.CostPricing})
}
return adminChannelModelResponse{ChannelModel: item, PriceTiers: tiers}
}