feat: aliyun sms
This commit is contained in:
@@ -11,6 +11,20 @@ type LoginValidator struct {
|
||||
SmsCode string `validate:"required_if=GrantType sms,omitempty,max=8"`
|
||||
}
|
||||
|
||||
type SendSmsValidator struct {
|
||||
Mobile string `validate:"required,len=11"`
|
||||
Scene int32 `validate:"required,oneof=1 2"`
|
||||
}
|
||||
|
||||
func (p SendSmsValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"Mobile.required": "手机号不能为空",
|
||||
"Mobile.len": "手机号格式错误",
|
||||
"Scene.required": "短信场景不能为空",
|
||||
"Scene.oneof": "短信场景不正确",
|
||||
}
|
||||
}
|
||||
|
||||
func (p LoginValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"ClientCode.required": "端编码不能为空",
|
||||
|
||||
Reference in New Issue
Block a user