首次提交:初始化项目代码

This commit is contained in:
sunct
2026-07-31 15:24:14 +08:00
commit 8d3c97bd01
73 changed files with 11720 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
package validator
import (
"cloudnest/internal/pkg/logger"
"github.com/go-playground/validator/v10"
)
// Validator is the global validator instance.
// Validator 是全局验证器实例。
var Validator *validator.Validate
// Init initializes the validator.
// Init 初始化验证器。
//
// Note:
// - Should be called once during application startup.
// - Creates a new validator instance with default settings.
//
// 注意:
// - 应在应用程序启动时调用一次。
// - 使用默认设置创建新的验证器实例。
func Init() {
Validator = validator.New()
logger.Info("validator initialized")
}