|
|
|
@ -153,11 +153,18 @@ func RequiredIf(fl validator.FieldLevel) bool {
|
|
|
|
|
sessionType := fl.Parent().FieldByName("SessionType").Int()
|
|
|
|
|
switch sessionType {
|
|
|
|
|
case 1, 4:
|
|
|
|
|
log.ZDebug(context.Background(), "1", sessionType)
|
|
|
|
|
if fl.StructFieldName() == "RecvID" {
|
|
|
|
|
log.ZDebug(context.Background(), "2", sessionType)
|
|
|
|
|
|
|
|
|
|
return fl.Field().String() != ""
|
|
|
|
|
}
|
|
|
|
|
case 2, 3:
|
|
|
|
|
log.ZDebug(context.Background(), "3", sessionType)
|
|
|
|
|
|
|
|
|
|
if fl.StructFieldName() == "GroupID" {
|
|
|
|
|
log.ZDebug(context.Background(), "4", sessionType)
|
|
|
|
|
|
|
|
|
|
return fl.Field().String() != ""
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|