2.0 KiB
2.0 KiB
2026-05-28
Docker 构建 & 部署
- 项目使用多阶段 Docker 构建(bun前端 → golang后端 → debian运行时)
- 国内构建需要添加
ENV GOPROXY=https://goproxy.cn,direct到 Dockerfile builder2 阶段 - docker-compose.yml 中 image 需改为本地镜像名
token-factory:latest才能使用自建镜像
代码修复
ModelTag和ModelTestResult未加入 AutoMigrate 列表,导致model_tags和model_test_results表缺失- 已在 model/main.go 的
migrateDB()和migrateDBFast()两处添加
- 已在 model/main.go 的
- Dockerfile 中添加了 GOPROXY=goproxy.cn 解决国内网络无法访问 proxy.golang.org 的问题
模型广场数据链路分析
- GET /api/pricing 3层过滤: abilities(enabled) → ModelHasConfiguredPricing(倍率/价格表) → BuildPricingAPIItems(渠道+单测门禁)
- 模型名必须与 ModelRatio/ModelPrice 中的 key 精确匹配(区分大小写)
- 模型广场需: home_page_content为空 + abilities有记录 + 倍率表有配置 + models表status=1 + 单测通过
- 设置页面仅 Root 用户(role=100)可见,Admin(role=10)不可见
- 倍率配置在: 设置 → 分组与模型定价设置(RatioSetting组件)
DeepSeek 模型配置
- 渠道名为"DeepSeek",实际模型名为
deepseek-v4-flash和deepseek-v4-pro - ModelRatio 中只有
DeepSeek(大写),缺少deepseek-v4-flash和deepseek-v4-pro - 已通过 SQL 在 ModelRatio 中添加这两个模型名的倍率配置
单测门禁问题(核心阻断)
model_test_results表不存在时,BuildPricingAPIItems中testMs永远为0- 第264行:
if !includeUntestedChannelPricingRows && testMs <= 0 { continue }跳过所有条目 - 即使
LoadChannelPricingTestSuccessIndex对空表返回空map不报错,但testMs<=0门禁仍阻断 - 解决方案: 手动创建表并插入测试记录,或在管理后台执行渠道测试
- 已通过 SQL 创建
model_test_results表并插入 deepseek 渠道的两条测试记录(testMs=500/800)