feat: user update mobile
This commit is contained in:
@@ -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": "验证码过长",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user