feat: user update mobile

This commit is contained in:
zzw
2026-10-21 13:55:38 +08:00
parent 2aac448925
commit 8f1e63c95a
5 changed files with 30 additions and 9 deletions
+9 -6
View File
@@ -67,16 +67,19 @@ type UpdateValidator struct {
Birthday string `validate:"omitempty,max=32"`
Mobile string `validate:"omitempty,len=11"`
RealName string `validate:"omitempty,max=64"`
SmsCode string `validate:"required_with=Mobile,omitempty,max=8"`
}
func (p UpdateValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{
"Name.max": "昵称过长",
"Avatar.max": "头像地址过长",
"Gender.oneof": "性别不正确",
"Birthday.max": "生日过长",
"Mobile.len": "手机号格式不正确",
"RealName.max": "真实姓名过长",
"Name.max": "昵称过长",
"Avatar.max": "头像地址过长",
"Gender.oneof": "性别不正确",
"Birthday.max": "生日过长",
"Mobile.len": "手机号格式不正确",
"RealName.max": "真实姓名过长",
"SmsCode.required_with": "修改手机号时验证码不能为空",
"SmsCode.max": "验证码过长",
}
}