feat(user): 昵称上限放宽到 20 字(与客户端/原型一致) (#47)

ProfileUpdateRequest.nickname 的 max_length 16 → 20,与客户端 take(20) 和
原型 settings.html(maxlength=20)对齐。修复 17–20 字昵称保存时后端返回 422、
客户端弹「更新失败,请重试」的问题。DB 列为 String(64),放得下,无需迁移。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: zzhyyyyy <2685922758@qq.com>
Reviewed-on: #47
Co-authored-by: zhuzihao <zhuzihao@wonderable.ai>
Co-committed-by: zhuzihao <zhuzihao@wonderable.ai>
This commit was merged in pull request #47.
This commit is contained in:
2026-06-12 23:27:35 +08:00
committed by marco
parent e8bd12cc1f
commit 25484aadb8
+1 -1
View File
@@ -5,7 +5,7 @@ from pydantic import BaseModel, Field, field_validator
class ProfileUpdateRequest(BaseModel):
nickname: str = Field(..., min_length=1, max_length=16, description="昵称,1-16")
nickname: str = Field(..., min_length=1, max_length=20, description="昵称,1-20")
@field_validator("nickname")
@classmethod