fix: internal user
CI / changes (push) Successful in 40s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 24s
CI / chore (push) Successful in 23s
CI / equipment (push) Successful in 1s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 0s
CI / payment (push) Successful in 1s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 23s
CI / task (push) Successful in 0s
CI / user (push) Successful in 24s
CI / wecom (push) Successful in 0s
CI / changes (push) Successful in 40s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 24s
CI / chore (push) Successful in 23s
CI / equipment (push) Successful in 1s
CI / express (push) Successful in 0s
CI / factory (push) Successful in 0s
CI / payment (push) Successful in 1s
CI / product (push) Successful in 0s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 23s
CI / task (push) Successful in 0s
CI / user (push) Successful in 24s
CI / wecom (push) Successful in 0s
This commit is contained in:
@@ -61,6 +61,7 @@ type InternalCreateValidator struct {
|
||||
CredentialType []string `validate:"omitempty,dive,oneof=password sms"`
|
||||
Identifier string `validate:"omitempty,max=128"`
|
||||
Secret string `validate:"omitempty,max=255"`
|
||||
BizId int64 `validate:"omitempty,gte=0"`
|
||||
}
|
||||
|
||||
func (p InternalCreateValidator) GetMessage() validate.ValidatorMessages {
|
||||
@@ -125,21 +126,24 @@ func (p InternalCheckCreateValidator) GetMessage() validate.ValidatorMessages {
|
||||
}
|
||||
|
||||
type InternalCheckUpdateValidator struct {
|
||||
UserId int64 `validate:"required,gt=0"`
|
||||
Mobile string `validate:"required,max=20"`
|
||||
BizId int64 `validate:"required,gt=0"`
|
||||
Mobile string `validate:"required,max=20"`
|
||||
SubjectType string `validate:"required,oneof=sale store user"`
|
||||
}
|
||||
|
||||
func (p InternalCheckUpdateValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"UserId.required": "用户ID不能为空",
|
||||
"UserId.gt": "用户ID必须大于0",
|
||||
"Mobile.required": "手机号不能为空",
|
||||
"Mobile.max": "手机号过长",
|
||||
"BizId.required": "业务用户ID不能为空",
|
||||
"BizId.gt": "业务用户ID必须大于0",
|
||||
"Mobile.required": "手机号不能为空",
|
||||
"Mobile.max": "手机号过长",
|
||||
"SubjectType.required": "主体类型不能为空",
|
||||
"SubjectType.oneof": "主体类型不正确",
|
||||
}
|
||||
}
|
||||
|
||||
type InternalUpdateValidator struct {
|
||||
UserId int64 `validate:"required,gt=0"`
|
||||
UserId int64 `validate:"omitempty,gte=0"`
|
||||
Mobile string `validate:"required,max=20"`
|
||||
Name string `validate:"omitempty,max=64"`
|
||||
Avatar string `validate:"omitempty,max=255"`
|
||||
@@ -149,15 +153,19 @@ type InternalUpdateValidator struct {
|
||||
CredentialType []string `validate:"omitempty"`
|
||||
Identifier string `validate:"omitempty,max=128"`
|
||||
Secret string `validate:"omitempty,max=255"`
|
||||
BizId int64 `validate:"required,gt=0"`
|
||||
SubjectType string `validate:"required,oneof=sale store user"`
|
||||
}
|
||||
|
||||
func (p InternalUpdateValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"UserId.required": "用户ID不能为空",
|
||||
"UserId.gt": "用户ID必须大于0",
|
||||
"Mobile.required": "手机号不能为空",
|
||||
"Mobile.max": "手机号过长",
|
||||
"ClientCode.max": "端编码过长",
|
||||
"CredentialType.oneof": "凭证类型不正确",
|
||||
"BizId.required": "业务用户ID不能为空",
|
||||
"BizId.gt": "业务用户ID必须大于0",
|
||||
"SubjectType.required": "主体类型不能为空",
|
||||
"SubjectType.oneof": "主体类型不正确",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user