feat: soften quota messaging

This commit is contained in:
2026-07-31 16:10:35 +08:00
parent 4e872febd5
commit ec9f8a015a
4 changed files with 34 additions and 4 deletions

View File

@@ -226,7 +226,10 @@ class ChatService:
@staticmethod
def _ensure_quota(user: User) -> None:
if user.daily_chat_used >= user.daily_chat_limit:
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="今日提问次数已用完")
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail="今天的陪伴对话已经比较多了,建议先消化当前回答和功课;如需继续使用,可以联系运营老师确认权益。",
)
@staticmethod
def _ensure_topic_quota(db: Session, user: User, session: ChatSession, entitlement) -> None: