修复不同的表验证跳过

This commit is contained in:
Yavolte 2025-08-29 09:22:59 +08:00
parent dc4d31a9fd
commit 531c3ad62d
1 changed files with 8 additions and 3 deletions

View File

@ -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
}