修复不同的表验证跳过
This commit is contained in:
parent
dc4d31a9fd
commit
531c3ad62d
|
@ -3,14 +3,15 @@ package validate
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"git.nobla.cn/golang/rest"
|
||||
"git.nobla.cn/golang/rest/types"
|
||||
validator "github.com/go-playground/validator/v10"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/schema"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Validate struct {
|
||||
|
@ -199,6 +200,10 @@ func (validate *Validate) Validate(db *gorm.DB) {
|
|||
} else {
|
||||
return
|
||||
}
|
||||
//if not current table, skip it
|
||||
if runtimeScope.TableName != stmt.Table {
|
||||
return
|
||||
}
|
||||
if runtimeScope.Schemas == nil {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue