"""用户资料(昵称/头像)相关请求 schemas。响应复用 [auth.UserOut]。""" from __future__ import annotations from pydantic import BaseModel, Field, field_validator class ProfileUpdateRequest(BaseModel): nickname: str = Field(..., min_length=1, max_length=16, description="昵称,1-16 字") @field_validator("nickname") @classmethod def _strip_non_blank(cls, v: str) -> str: v = v.strip() if not v: raise ValueError("昵称不能为空") return v class OkResponse(BaseModel): ok: bool = True