|
|
@ -1129,13 +1129,7 @@ func isEq(fl FieldLevel) bool { |
|
|
|
return int64(field.Len()) == p |
|
|
|
return int64(field.Len()) == p |
|
|
|
|
|
|
|
|
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
var p int64 |
|
|
|
p := asIntFromType(field.Type(), param) |
|
|
|
|
|
|
|
|
|
|
|
if field.Type() == timeDurationType { |
|
|
|
|
|
|
|
p = asIntFromTimeDuration(param) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
p = asInt(param) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return field.Int() == p |
|
|
|
return field.Int() == p |
|
|
|
|
|
|
|
|
|
|
@ -1547,13 +1541,7 @@ func isGte(fl FieldLevel) bool { |
|
|
|
return int64(field.Len()) >= p |
|
|
|
return int64(field.Len()) >= p |
|
|
|
|
|
|
|
|
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
var p int64 |
|
|
|
p := asIntFromType(field.Type(), param) |
|
|
|
|
|
|
|
|
|
|
|
if field.Type() == timeDurationType { |
|
|
|
|
|
|
|
p = asIntFromTimeDuration(param) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
p = asInt(param) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return field.Int() >= p |
|
|
|
return field.Int() >= p |
|
|
|
|
|
|
|
|
|
|
@ -1600,13 +1588,7 @@ func isGt(fl FieldLevel) bool { |
|
|
|
return int64(field.Len()) > p |
|
|
|
return int64(field.Len()) > p |
|
|
|
|
|
|
|
|
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
var p int64 |
|
|
|
p := asIntFromType(field.Type(), param) |
|
|
|
|
|
|
|
|
|
|
|
if field.Type() == timeDurationType { |
|
|
|
|
|
|
|
p = asIntFromTimeDuration(param) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
p = asInt(param) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return field.Int() > p |
|
|
|
return field.Int() > p |
|
|
|
|
|
|
|
|
|
|
@ -1649,13 +1631,7 @@ func hasLengthOf(fl FieldLevel) bool { |
|
|
|
return int64(field.Len()) == p |
|
|
|
return int64(field.Len()) == p |
|
|
|
|
|
|
|
|
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
var p int64 |
|
|
|
p := asIntFromType(field.Type(), param) |
|
|
|
|
|
|
|
|
|
|
|
if field.Type() == timeDurationType { |
|
|
|
|
|
|
|
p = asIntFromTimeDuration(param) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
p = asInt(param) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return field.Int() == p |
|
|
|
return field.Int() == p |
|
|
|
|
|
|
|
|
|
|
@ -1791,13 +1767,7 @@ func isLte(fl FieldLevel) bool { |
|
|
|
return int64(field.Len()) <= p |
|
|
|
return int64(field.Len()) <= p |
|
|
|
|
|
|
|
|
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
var p int64 |
|
|
|
p := asIntFromType(field.Type(), param) |
|
|
|
|
|
|
|
|
|
|
|
if field.Type() == timeDurationType { |
|
|
|
|
|
|
|
p = asIntFromTimeDuration(param) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
p = asInt(param) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return field.Int() <= p |
|
|
|
return field.Int() <= p |
|
|
|
|
|
|
|
|
|
|
@ -1844,13 +1814,7 @@ func isLt(fl FieldLevel) bool { |
|
|
|
return int64(field.Len()) < p |
|
|
|
return int64(field.Len()) < p |
|
|
|
|
|
|
|
|
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: |
|
|
|
var p int64 |
|
|
|
p := asIntFromType(field.Type(), param) |
|
|
|
|
|
|
|
|
|
|
|
if field.Type() == timeDurationType { |
|
|
|
|
|
|
|
p = asIntFromTimeDuration(param) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
p = asInt(param) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return field.Int() < p |
|
|
|
return field.Int() < p |
|
|
|
|
|
|
|
|
|
|
|