diff --git a/services/analysis/internal/logic/analysisdevice/faceLoginLogic.go b/services/analysis/internal/logic/analysisdevice/faceLoginLogic.go index 4260552..519b917 100644 --- a/services/analysis/internal/logic/analysisdevice/faceLoginLogic.go +++ b/services/analysis/internal/logic/analysisdevice/faceLoginLogic.go @@ -64,9 +64,12 @@ func (l *FaceLoginLogic) FaceLogin(in *analysis.FaceLoginReq) (*analysis.Respons l.Infof("face login user_id=%d score=%v err=%v", userID, score, err) if err != nil || userID < utils.NumberOne { + + l.Infof("XXXXXX", utils.GetConfigString("base.mode")) if utils.GetConfigString("base.mode") == "dev" { userID = 1 } else { + l.Infof("AAAAAAAAAA") return common.FailResponse(utils.ErrorFaceNotMatch), nil } } diff --git a/services/user/validator/user.go b/services/user/validator/user.go index 028f1ba..cb979c1 100644 --- a/services/user/validator/user.go +++ b/services/user/validator/user.go @@ -61,22 +61,26 @@ func (p LoginValidator) GetMessage() validate.ValidatorMessages { } type UpdateValidator struct { - Name string `validate:"omitempty,max=64"` - Avatar string `validate:"omitempty,max=512"` - Gender uint32 `validate:"omitempty,oneof=0 1 2 3"` - Birthday string `validate:"omitempty,max=32"` + Name string `validate:"required,max=64"` + Avatar string `validate:"required,max=512"` + Gender uint32 `validate:"required,oneof=1 2 3"` + Birthday string `validate:"required,max=32"` Mobile string `validate:"omitempty,len=11"` RealName string `validate:"omitempty,max=64"` } func (p UpdateValidator) GetMessage() validate.ValidatorMessages { return validate.ValidatorMessages{ - "Name.max": "昵称过长", - "Avatar.max": "头像地址过长", - "Gender.oneof": "性别不正确", - "Birthday.max": "生日过长", - "Mobile.len": "手机号格式不正确", - "RealName.max": "真实姓名过长", + "Name.required": "昵称不能为空", + "Name.max": "昵称过长", + "Avatar.required": "头像不能为空", + "Avatar.max": "头像地址过长", + "Gender.required": "性别不能为空", + "Gender.oneof": "性别不正确", + "Birthday.required": "生日不能为空", + "Birthday.max": "生日过长", + "Mobile.len": "手机号格式不正确", + "RealName.max": "真实姓名过长", } }