mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
新增渠道管理功能,支持三种计费模式(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: 定价编辑组件 - 支持三种计费模式切换 + 区间编辑