31 lines
840 B
Python
31 lines
840 B
Python
from pydantic import BaseModel, Field
|
|
|
|
from app.schemas.user import UserOut
|
|
|
|
|
|
class WeChatLoginRequest(BaseModel):
|
|
code: str = Field(min_length=1, max_length=512)
|
|
|
|
|
|
class WeChatLoginResponse(BaseModel):
|
|
binding_required: bool
|
|
bind_token: str | None = None
|
|
token: str | None = None
|
|
user: UserOut | None = None
|
|
|
|
|
|
class WeChatBindRequest(BaseModel):
|
|
bind_token: str = Field(min_length=1)
|
|
invite_code: str = Field(min_length=1, max_length=20)
|
|
student_id: str = Field(min_length=1, max_length=50)
|
|
phone_code: str = Field(min_length=1, max_length=512)
|
|
|
|
|
|
class WeChatPhoneUpdateRequest(BaseModel):
|
|
phone_code: str = Field(min_length=1, max_length=512)
|
|
|
|
|
|
class WeChatCurrentBindRequest(BaseModel):
|
|
code: str = Field(min_length=1, max_length=512)
|
|
phone_code: str = Field(min_length=1, max_length=512)
|