feat(viral-video): 动态积分定价(按tokens×单价×1.3,保留两位小数) #2152
Reference in New Issue
Block a user
Delete Branch "feat/2151-viral-video-dynamic-pricing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
- 新增定价配置 VIRAL_VIDEO_MODEL_PRICES(Seedance 2.5/2.0 × 480p/720p/1080p × 是否含视频输入) - 公式:tokens = duration×width×height×fps/1024; video_cost=tokens/1M×price; total=round((video_cost+0.15)×1.3,2) - 积分字段全部改 Float 支持小数(points_accounts/points_transactions/users.points_balance/viral_video_jobs.credits_cost) - 新增 POST /api/v1/viral-video/estimate-credits 预估积分接口 - confirm-copy 阶段预扣积分(余额不足402),失败全额退款,完成后按真实usage.completion_tokens多退少补 - retry 重试不重复扣费(检测credits_prepaid/credits_cost跳过预扣) - ai_client.video_generation 返回 {video_path, usage} 供结算使用真实tokens - video_resolution字段透传(支持480p/720p/1080p及别名普清/高清/超清) - 新增093数据库迁移(Float类型转换+3个新列) - CREDITS_VIRAL_VIDEO_COST固定50常量删除 - 125个核心单测全绿,样例:15s/720p/9:16≈9.52积分, 30s/1080p≈46.34积分LGTM,自审通过。动态积分定价全链路(预估/预扣/结算/退款/retry不重复扣),17文件/+563行,125核心单测+16241全量单测通过。
🚀 预览环境已部署
🗑️ 预览环境已清理
PR #2152 已关闭或合并,对应的预览环境已被清理。