fengsilin
f0f0215b20
fix(pricing): 修复缓存倍率写入默认值1和缓存创建token丢失
1. CopyGlobalPricing 检查 ratio 查找的 bool 返回值,未找到时写 0
而非写入 fallback 值 1,避免覆盖全局正确的 0.1
2. Claude 响应使用 GetCacheCreationTotalTokens() 替代直接读
CacheCreationInputTokens,兼容新版本子对象格式
3. 新增 GetAudioRatioV2/GetAudioCompletionRatioV2 带 bool 返回
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 hafta önce
fengsilin
00058cd671
refactor(channel-pricing): 提取辅助方法消除重复代码,修复缓存一致性
- 提取 PriceData.ApplyChannelPricingRatios 消除 ModelPriceHelper 和
UpdatePriceDataForChannelPricing 中重复的 ~30 行比率回退逻辑
- 提取 ChannelPricing.ApplyFields 消除 controller 中 4 处相同的字段赋值
- 提取 setCache/removeCache 辅助函数统一写穿透缓存操作
- 将 claudeCacheCreation1hMultiplier 常量移至 types 包避免循环依赖
- 修复 BatchUpsertChannelPricing 成功后未刷新内存缓存的 bug
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 hafta önce
fengsilin
235f7c6e5f
refactor(channel-pricing): 提取 ParseTagIds 辅助函数 + 移除调试 console.log
- 将 tag ID 解析逻辑提取为 model.ParseTagIds,消除 model 层和 controller 层重复代码
- 统一 TrimSpace 处理(之前 controller 版本漏了)
- 移除 ChannelPricingView 残留的 console.log('Expanded keys:')
- 删除多余空行
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 hafta önce
fengsilin
646f37dd4b
feat(channel-pricing): Controller 扩展 API 支持新字段 + 输入校验 + 操作日志
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 hafta önce
fengsilin
62737d3f8c
feat: 添加模型详情页渠道价格展示 & 优化筛选行布局
- 新增 API 端点获取模型在各渠道的定价信息,支持全局价格回退
- 在模型详情侧边栏添加渠道价格卡片,显示所有支持该模型的渠道
- 优化 HorizontalFilterRow 组件,改用 flex-wrap 自动换行布局
- 隐藏数量为 0 的模型类型筛选项
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 ay önce
fengsilin
447ccd09b2
feat: add ChannelPricing CRUD controller
- GetAllChannelPricing: get all channel pricings with pagination
- GetChannelPricingByModel: get pricings for a specific model
- CreateChannelPricing: create or update channel pricing
- BatchCreateChannelPricing: batch create/update pricings
- DeleteChannelPricing: delete channel pricing
- CopyGlobalPricing: copy global pricing from ratio_setting to channel
- GetChannelPricingWithTags: get pricings with tag details
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 ay önce