diff --git a/utils/check/check.go b/utils/check/check.go index b0622693..d4d4df3f 100644 --- a/utils/check/check.go +++ b/utils/check/check.go @@ -63,3 +63,13 @@ var checkModuleRe = regexp.MustCompile("[^\\.a-zA-Z_\\-0-9]") func CheckModuleQuery(moduleQuery string) bool { return !checkModuleRe.MatchString(moduleQuery) } + +// 检测数据的范围是否符合要求 +func CheckValueRange[T comparable](v T, rangevalues ...T) bool { + for _, rv := range rangevalues { + if v == rv { + return true + } + } + return false +} diff --git a/utils/fssql/metadata.go b/utils/fssql/metadata.go index a9146ad2..0415d149 100644 --- a/utils/fssql/metadata.go +++ b/utils/fssql/metadata.go @@ -3,6 +3,7 @@ package fssql import ( "encoding/json" "fmt" + "log" "reflect" "gorm.io/gorm" @@ -76,6 +77,8 @@ func MetadataModulePATCH(tx *gorm.DB, module string, tableStructPointer any, upd } } + log.Println(string(metadata)) + var args []any args = append(args, metadata, metadata)