feat(points): 积分系统收尾 + 充值弹窗改造 + 命名统一
后端: - 微信回调 db.commit 失败仍返回 SUCCESS,避免无限重试 - recharge() 加 order_id 幂等保护,防重复充值 - time_expire 使用北京时间(UTC+8),修复时区 bug - 充值档位后端配置化(points-config.yaml + /recharge-options API) - 代码审查 20 项修复(认证加固、扣费顺序、错误响应、状态同步等) 前端: - 充值弹窗:自动轮询 + 【我已支付】手动兜底 - 二维码倒计时显示,过期后遮罩 + 刷新按钮 - 充值档位从后端动态加载 - 去掉 select/qrcode 弹窗标题,金额红色突出显示 - 全项目命名统一(视频生成/压制成片/配音合成/声音复刻等) - Modal 关闭按钮独立于 title 显示
This commit is contained in:
@@ -10,7 +10,7 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from fastapi import APIRouter, Depends
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.api.deps import get_current_user
|
||||
@@ -59,7 +59,7 @@ async def polish_content(
|
||||
AI 润色文案/画面描述
|
||||
|
||||
- `polishType=scene`: 润色画面描述(根据 shot_type 自动区分分镜/空镜)
|
||||
- `polishType=voiceover`: 润色配音文案
|
||||
- `polishType=voiceover`: 润色配音文本
|
||||
|
||||
参数:
|
||||
- `shot_type`: "segment"(分镜)或 "empty_shot"(空镜),画面润色时必填
|
||||
@@ -92,18 +92,10 @@ async def polish_content(
|
||||
)
|
||||
except ValueError as e:
|
||||
logger.warning(f"[Polish] 润色失败: {e}")
|
||||
return success_response(
|
||||
code=500,
|
||||
message="润色失败,请检查输入内容后重试",
|
||||
data=None,
|
||||
)
|
||||
raise HTTPException(status_code=500, detail="润色失败,请检查输入内容后重试")
|
||||
except Exception as e:
|
||||
logger.error(f"[Polish] 润色异常: {e}")
|
||||
return success_response(
|
||||
code=500,
|
||||
message=f"{type_name}润色失败,请稍后重试",
|
||||
data=None,
|
||||
)
|
||||
raise HTTPException(status_code=500, detail=f"{type_name}润色失败,请稍后重试")
|
||||
|
||||
|
||||
@router.get("/model-health", response_model=ApiResponse[ModelHealthResponse])
|
||||
@@ -157,11 +149,7 @@ async def generate_title(
|
||||
user_template = load_prompt("user/title")
|
||||
|
||||
if not system_prompt or not user_template:
|
||||
return success_response(
|
||||
code=500,
|
||||
message="标题生成提示词文件缺失",
|
||||
data=None,
|
||||
)
|
||||
raise HTTPException(status_code=500, detail="标题生成提示词文件缺失")
|
||||
|
||||
# 根据使用场景确定描述
|
||||
if request.usage == "cover":
|
||||
@@ -221,15 +209,7 @@ async def generate_title(
|
||||
)
|
||||
except TimeoutError:
|
||||
logger.warning("[generate_title] 标题生成超时")
|
||||
return success_response(
|
||||
code=500,
|
||||
message="标题生成超时,请重试",
|
||||
data=None,
|
||||
)
|
||||
raise HTTPException(status_code=500, detail="标题生成超时,请重试")
|
||||
except Exception as e:
|
||||
logger.error(f"[generate_title] 标题生成失败: {e}")
|
||||
return success_response(
|
||||
code=500,
|
||||
message=f"标题生成失败: {str(e)}",
|
||||
data=None,
|
||||
)
|
||||
raise HTTPException(status_code=500, detail=f"标题生成失败: {str(e)}")
|
||||
|
||||
Reference in New Issue
Block a user