feat(channel): 缓存扁平化 + 网关映射集成 + 计费模式统一 + 模型限制
- 缓存按 (groupID, platform, model) 三维 key 扁平化,避免跨平台同名模型冲突
- buildCache 批量查询 group platform,按平台过滤展开定价和映射
- model_mapping 改为嵌套格式 {platform: {src: dst}}
- channel_model_pricing 新增 platform 列
- 前端按平台维度重构:每个平台独立配置分组/映射/定价
- 迁移 086: platform 列 + model_mapping 嵌套格式迁移
This commit is contained in:
@@ -22,6 +22,7 @@ export interface PricingInterval {
|
||||
|
||||
export interface ChannelModelPricing {
|
||||
id?: number
|
||||
platform: string
|
||||
models: string[]
|
||||
billing_mode: BillingMode
|
||||
input_price: number | null
|
||||
@@ -42,7 +43,7 @@ export interface Channel {
|
||||
restrict_models: boolean
|
||||
group_ids: number[]
|
||||
model_pricing: ChannelModelPricing[]
|
||||
model_mapping: Record<string, string>
|
||||
model_mapping: Record<string, Record<string, string>> // platform → {src→dst}
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
@@ -52,7 +53,7 @@ export interface CreateChannelRequest {
|
||||
description?: string
|
||||
group_ids?: number[]
|
||||
model_pricing?: ChannelModelPricing[]
|
||||
model_mapping?: Record<string, string>
|
||||
model_mapping?: Record<string, Record<string, string>>
|
||||
billing_model_source?: string
|
||||
restrict_models?: boolean
|
||||
}
|
||||
@@ -63,7 +64,7 @@ export interface UpdateChannelRequest {
|
||||
status?: string
|
||||
group_ids?: number[]
|
||||
model_pricing?: ChannelModelPricing[]
|
||||
model_mapping?: Record<string, string>
|
||||
model_mapping?: Record<string, Record<string, string>>
|
||||
billing_model_source?: string
|
||||
restrict_models?: boolean
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user