mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
v2 -> v3
This commit is contained in:
@ -13,9 +13,9 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/internal/intlog"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
"github.com/gogf/gf/v3/internal/intlog"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
)
|
||||
|
||||
// CustomMsg is the custom error message type,
|
||||
|
||||
@ -9,10 +9,10 @@ package gvalid
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/container/gset"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
// Error is the validation error for validation result.
|
||||
|
||||
@ -12,8 +12,8 @@ import (
|
||||
"reflect"
|
||||
"runtime"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/internal/intlog"
|
||||
"github.com/gogf/gf/v3/container/gvar"
|
||||
"github.com/gogf/gf/v3/internal/intlog"
|
||||
)
|
||||
|
||||
// RuleFunc is the custom function for data validation.
|
||||
|
||||
@ -11,11 +11,11 @@ import (
|
||||
"errors"
|
||||
"reflect"
|
||||
|
||||
"github.com/gogf/gf/v2/i18n/gi18n"
|
||||
"github.com/gogf/gf/v2/internal/reflection"
|
||||
"github.com/gogf/gf/v2/internal/utils"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/i18n/gi18n"
|
||||
"github.com/gogf/gf/v3/internal/reflection"
|
||||
"github.com/gogf/gf/v3/internal/utils"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
// Validator is the validation manager for chaining operations.
|
||||
|
||||
@ -12,9 +12,9 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/internal/reflection"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/internal/reflection"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
func (v *Validator) doCheckMap(ctx context.Context, params interface{}) Error {
|
||||
|
||||
@ -11,12 +11,12 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/internal/empty"
|
||||
"github.com/gogf/gf/v2/os/gstructs"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/internal/empty"
|
||||
"github.com/gogf/gf/v3/os/gstructs"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gmeta"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
func (v *Validator) doCheckStruct(ctx context.Context, object interface{}) Error {
|
||||
|
||||
@ -12,14 +12,14 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gvalid/internal/builtin"
|
||||
"github.com/gogf/gf/v3/container/gvar"
|
||||
"github.com/gogf/gf/v3/encoding/gjson"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gvalid/internal/builtin"
|
||||
)
|
||||
|
||||
type doCheckValueInput struct {
|
||||
|
||||
@ -9,7 +9,7 @@ package gvalid
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gvalid/internal/builtin"
|
||||
"github.com/gogf/gf/v3/util/gvalid/internal/builtin"
|
||||
)
|
||||
|
||||
// getErrorMessageByRule retrieves and returns the error message for specified rule.
|
||||
|
||||
@ -10,8 +10,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
func ExampleRule_Required() {
|
||||
|
||||
@ -11,13 +11,13 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/i18n/gi18n"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gvalid"
|
||||
"github.com/gogf/gf/v3/container/gvar"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/i18n/gi18n"
|
||||
"github.com/gogf/gf/v3/os/gctx"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gvalid"
|
||||
)
|
||||
|
||||
func ExampleNew() {
|
||||
|
||||
@ -10,10 +10,10 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/gvalid"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/gvalid"
|
||||
)
|
||||
|
||||
func Test_CheckMap1(t *testing.T) {
|
||||
|
||||
@ -10,11 +10,11 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/container/gvar"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
func Test_CheckStruct(t *testing.T) {
|
||||
|
||||
@ -9,8 +9,8 @@ package gvalid_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
)
|
||||
|
||||
func Test_CI(t *testing.T) {
|
||||
|
||||
@ -11,8 +11,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
)
|
||||
|
||||
func Test_Map(t *testing.T) {
|
||||
|
||||
@ -11,11 +11,11 @@ import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
"github.com/gogf/gf/v2/util/gvalid"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v3/util/gvalid"
|
||||
)
|
||||
|
||||
func Test_CustomRule1(t *testing.T) {
|
||||
|
||||
@ -10,9 +10,9 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/i18n/gi18n"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/gvalid"
|
||||
"github.com/gogf/gf/v3/i18n/gi18n"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/gvalid"
|
||||
)
|
||||
|
||||
func TestValidator_I18n(t *testing.T) {
|
||||
|
||||
@ -10,10 +10,10 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/gvalid"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/gvalid"
|
||||
)
|
||||
|
||||
type UserCreateReq struct {
|
||||
|
||||
@ -9,8 +9,8 @@ package gvalid_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
)
|
||||
|
||||
func Test_CheckStruct_Recursive_Struct(t *testing.T) {
|
||||
|
||||
@ -10,13 +10,13 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/os/gctx"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -1590,7 +1590,7 @@ func Test_Enums(t *testing.T) {
|
||||
t.AssertNil(err)
|
||||
defer t.AssertNil(gtag.SetGlobalEnums(oldEnumsJson))
|
||||
|
||||
err = gtag.SetGlobalEnums(`{"github.com/gogf/gf/v2/util/gvalid_test.EnumsTest": ["a","b"]}`)
|
||||
err = gtag.SetGlobalEnums(`{"github.com/gogf/gf/v3/util/gvalid_test.EnumsTest": ["a","b"]}`)
|
||||
t.AssertNil(err)
|
||||
|
||||
err = g.Validator().Data(&Params{
|
||||
|
||||
@ -9,7 +9,7 @@ package gvalid
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
)
|
||||
|
||||
func Test_parseSequenceTag(t *testing.T) {
|
||||
|
||||
@ -13,12 +13,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
"github.com/gogf/gf/v2/test/gtest"
|
||||
"github.com/gogf/gf/v2/util/guid"
|
||||
"github.com/gogf/gf/v2/util/gvalid"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/frame/g"
|
||||
"github.com/gogf/gf/v3/net/ghttp"
|
||||
"github.com/gogf/gf/v3/test/gtest"
|
||||
"github.com/gogf/gf/v3/util/guid"
|
||||
"github.com/gogf/gf/v3/util/gvalid"
|
||||
)
|
||||
|
||||
type Foo struct {
|
||||
|
||||
@ -13,7 +13,7 @@ package builtin
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v3/container/gvar"
|
||||
)
|
||||
|
||||
type Rule interface {
|
||||
|
||||
@ -9,9 +9,9 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleAfter implements `after` rule:
|
||||
|
||||
@ -9,9 +9,9 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleAfterEqual implements `after-equal` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/internal/json"
|
||||
"github.com/gogf/gf/v3/internal/json"
|
||||
)
|
||||
|
||||
// RuleArray implements `array` rule:
|
||||
|
||||
@ -9,9 +9,9 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleBefore implements `before` rule:
|
||||
|
||||
@ -9,9 +9,9 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleBeforeEqual implements `before-equal` rule:
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
// RuleBetween implements `between` rule:
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleDate implements `date` rule:
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
)
|
||||
|
||||
// RuleDateFormat implements `date-format` rule:
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v3/os/gtime"
|
||||
)
|
||||
|
||||
// RuleDatetime implements `datetime` rule:
|
||||
|
||||
@ -10,9 +10,9 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleDifferent implements `different` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleDomain implements `domain` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleEmail implements `email` rule:
|
||||
|
||||
@ -11,12 +11,12 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/internal/json"
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gtag"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/internal/json"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gtag"
|
||||
)
|
||||
|
||||
// RuleEnums implements `enums` rule:
|
||||
|
||||
@ -10,9 +10,9 @@ import (
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleGT implements `gt` rule:
|
||||
|
||||
@ -10,9 +10,9 @@ import (
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleGTE implements `gte` rule:
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
// RuleIn implements `in` rule:
|
||||
|
||||
@ -9,8 +9,8 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/net/gipv4"
|
||||
"github.com/gogf/gf/v2/net/gipv6"
|
||||
"github.com/gogf/gf/v3/net/gipv4"
|
||||
"github.com/gogf/gf/v3/net/gipv6"
|
||||
)
|
||||
|
||||
// RuleIp implements `ip` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/net/gipv4"
|
||||
"github.com/gogf/gf/v3/net/gipv4"
|
||||
)
|
||||
|
||||
// RuleIpv4 implements `ipv4` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/net/gipv6"
|
||||
"github.com/gogf/gf/v3/net/gipv6"
|
||||
)
|
||||
|
||||
// RuleIpv6 implements `ipv6` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/internal/json"
|
||||
"github.com/gogf/gf/v3/internal/json"
|
||||
)
|
||||
|
||||
// RuleJson implements `json` rule:
|
||||
|
||||
@ -11,8 +11,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
// RuleLength implements `length` rule:
|
||||
|
||||
@ -10,9 +10,9 @@ import (
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleLT implements `lt` rule:
|
||||
|
||||
@ -10,9 +10,9 @@ import (
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleLTE implements `lte` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleMac implements `mac` rule:
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
// RuleMax implements `max` rule:
|
||||
|
||||
@ -10,8 +10,8 @@ import (
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
// RuleMaxLength implements `max-length` rule:
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
// RuleMin implements `min` rule:
|
||||
|
||||
@ -10,8 +10,8 @@ import (
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
// RuleMinLength implements `min-length` rule:
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
)
|
||||
|
||||
// RuleNotIn implements `not-in` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleNotRegex implements `not-regex` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RulePassport implements `passport` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RulePassword implements `password` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RulePassword2 implements `password2` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RulePassword3 implements `password3` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RulePhone implements `phone` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RulePhoneLoose implements `phone-loose` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RulePostcode implements `postcode` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleQQ implements `qq` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleRegex implements `regex` rule:
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
"errors"
|
||||
"reflect"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
// RuleRequired implements `required` rule.
|
||||
|
||||
@ -10,10 +10,10 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleRequiredIf implements `required-if` rule:
|
||||
|
||||
@ -10,10 +10,10 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gcode"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/errors/gcode"
|
||||
"github.com/gogf/gf/v3/errors/gerror"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleRequiredIfAll implements `required-if-all` rule:
|
||||
|
||||
@ -10,8 +10,8 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleRequiredUnless implements `required-unless` rule:
|
||||
|
||||
@ -10,8 +10,8 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/internal/empty"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/internal/empty"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleRequiredWith implements `required-with` rule:
|
||||
|
||||
@ -10,8 +10,8 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/internal/empty"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/internal/empty"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleRequiredWithAll implements `required-with-all` rule:
|
||||
|
||||
@ -10,8 +10,8 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/internal/empty"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/internal/empty"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleRequiredWithout implements `required-without` rule:
|
||||
|
||||
@ -10,8 +10,8 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/internal/empty"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/internal/empty"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleRequiredWithoutAll implements `required-without-all` rule:
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleResidentId implements `resident-id` rule:
|
||||
|
||||
@ -10,9 +10,9 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gstr"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v2/util/gutil"
|
||||
"github.com/gogf/gf/v3/text/gstr"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gutil"
|
||||
)
|
||||
|
||||
// RuleSame implements `same` rule:
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"github.com/gogf/gf/v3/util/gconv"
|
||||
)
|
||||
|
||||
// RuleSize implements `size` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleTelephone implements `telephone` rule:
|
||||
|
||||
@ -9,7 +9,7 @@ package builtin
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v3/text/gregex"
|
||||
)
|
||||
|
||||
// RuleUrl implements `url` rule:
|
||||
|
||||
Reference in New Issue
Block a user