From db381c7df50cd9368e8dd52a481429384d60ff32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 28 Apr 2025 14:51:52 +0800 Subject: [PATCH] =?UTF-8?q?validate=20=E5=A2=9E=E5=8A=A0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abstract/validate.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 abstract/validate.go diff --git a/abstract/validate.go b/abstract/validate.go new file mode 100644 index 0000000..d559a42 --- /dev/null +++ b/abstract/validate.go @@ -0,0 +1,17 @@ +// Package abstract ... +// +// Description : abstract ... +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 2025-04-28 14:48 +package abstract + +// IValidate 验证接口约束 +type IValidate interface { + Run() error // 执行验证 + Result() any // 获取验证结果 + Marshal(marshalType string) ([]byte, error) // 结果序列化 + Map(marshalType string) (map[string]any, error) // 结果转map + Transform(targetType string, receiver any) error // 结果转任意类型 +}