49379fd045
- /api/v1/user: PATCH 改昵称、POST 上传头像、DELETE 注销账号(软删除+匿名化) - /api/v1/feedback: 提交反馈(内容/联系方式/截图入库) - 新增 media 模块(图片落盘+魔数校验)+ /media 静态服务 - feedback 表 + Alembic 迁移(部署需 alembic upgrade head) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
21 lines
566 B
Python
21 lines
566 B
Python
"""用户资料(昵称/头像)相关请求 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
|