44 lines
720 B
Go
44 lines
720 B
Go
package request
|
|
|
|
import (
|
|
"errors"
|
|
)
|
|
|
|
type CompleteUserInfoRequest struct {
|
|
Mobile string
|
|
Birthday string
|
|
NickName string
|
|
Gender string
|
|
Avatar string
|
|
}
|
|
|
|
// 注册用户信息签名验证
|
|
func (request *CompleteUserInfoRequest) CheckParameter() (err error) {
|
|
|
|
if len(request.Mobile) == 0 {
|
|
err = errors.New("手机号不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.NickName) == 0 {
|
|
err = errors.New("昵称不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.Gender) == 0 {
|
|
err = errors.New("性别不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.Avatar) == 0 {
|
|
err = errors.New("头像不能为空")
|
|
return
|
|
}
|
|
|
|
if len(request.NickName) > 30 {
|
|
err = errors.New("昵称长度不能超过30")
|
|
return
|
|
}
|
|
return
|
|
}
|