feat(models): 模型目录与计费 - 按展示名分组并隔离管理员积分成本
This commit is contained in:
22
backend/internal/handler/admin_channel_model_response.go
Normal file
22
backend/internal/handler/admin_channel_model_response.go
Normal 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}
|
||||
}
|
||||
Reference in New Issue
Block a user