from typing import Optional
from pydantic import BaseModel

class Token(BaseModel):
    access_token: str
    token_type: str

class TokenPayload(BaseModel):
    sub: Optional[str] = None

class LoginRequest(BaseModel):
    mobile: str
    password: str
    app_id: Optional[str] = None  # Optional for direct platform login
    remember_me: bool = False


class AppLoginRequest(BaseModel):
    app_id: str
    app_secret: str


class RejectRequest(BaseModel):
    """拒绝登录/同意请求的模型"""
    error: str = "access_denied"  # OAuth2 标准错误码
    error_description: Optional[str] = None  # 可选的错误描述