mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-20 15:06:36 +00:00
feat(channel): 渠道管理系统 — 多模式定价 + 统一计费解析
新增渠道管理功能,支持三种计费模式(Token 区间/按次/图片), 统一定价解析链(Channel → LiteLLM → Fallback), 无渠道配置时保持原有计费逻辑不变。 Backend: - 新增 channels/channel_groups/channel_model_pricing/channel_pricing_intervals 表 - ChannelService: atomic.Value + singleflight 缓存,通配符模型匹配 - ModelPricingResolver: 统一定价解析器 - BillingService: CalculateCostUnified 统一计费入口 - 完整输入验证(BillingMode/价格非负/名称长度) - 33 个单元测试覆盖核心路径 Frontend: - ChannelsView.vue: 渠道 CRUD 列表页 - PricingEntryCard.vue + IntervalRow.vue: 定价编辑组件 - 支持三种计费模式切换 + 区间编辑
This commit is contained in:
1 parent
9398ea7af5
commit
a9117600a5
27 files changed
+3682
-8
No files matched your search
@@ -74,6 +74,7 @@ var ProviderSet = wire.NewSet(
|
||||
NewUserGroupRateRepository,
|
||||
NewErrorPassthroughRepository,
|
||||
NewTLSFingerprintProfileRepository,
|
||||
NewChannelRepository,
|
||||
|
||||
// Cache implementations
|
||||
NewGatewayCache,
|
||||
|
||||
Reference in new issue
Block a user