add Registration Interface

This commit is contained in:
咕谷酱
2025-07-28 19:41:57 +08:00
parent 2cd84f6175
commit 80310d450b
3 changed files with 253 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
# OAuth 相关模型
from __future__ import annotations
from typing import List
from pydantic import BaseModel
@@ -34,3 +35,22 @@ class OAuthErrorResponse(BaseModel):
error_description: str
hint: str
message: str
class RegistrationErrorResponse(BaseModel):
"""注册错误响应模型"""
form_error: dict
class UserRegistrationErrors(BaseModel):
"""用户注册错误模型"""
username: List[str] = []
user_email: List[str] = []
password: List[str] = []
class RegistrationRequestErrors(BaseModel):
"""注册请求错误模型"""
message: str | None = None
redirect: str | None = None
user: UserRegistrationErrors | None = None