From ddc8bd1139980f75b8eab632a430752b8f880989 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期日, 27 十月 2024 23:25:22 +0800 Subject: [PATCH] [重大更新] update (实验性功能慎更)重构数据权限实现逻辑 支持任意mapper方法标注注解 无需再找真实mapper标注 --- ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/ValidatorUtils.java | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/ValidatorUtils.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/ValidatorUtils.java index f94f916..06b8fd6 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/ValidatorUtils.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/ValidatorUtils.java @@ -1,11 +1,11 @@ package org.dromara.common.core.utils; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - import jakarta.validation.ConstraintViolation; import jakarta.validation.ConstraintViolationException; import jakarta.validation.Validator; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + import java.util.Set; /** @@ -18,6 +18,13 @@ private static final Validator VALID = SpringUtils.getBean(Validator.class); + /** + * 瀵圭粰瀹氬璞¤繘琛屽弬鏁版牎楠岋紝骞舵牴鎹寚瀹氱殑鏍¢獙缁勮繘琛屾牎楠� + * + * @param object 瑕佽繘琛屾牎楠岀殑瀵硅薄 + * @param groups 鏍¢獙缁� + * @throws ConstraintViolationException 濡傛灉鏍¢獙涓嶉�氳繃锛屽垯鎶涘嚭鍙傛暟鏍¢獙寮傚父 + */ public static <T> void validate(T object, Class<?>... groups) { Set<ConstraintViolation<T>> validate = VALID.validate(object, groups); if (!validate.isEmpty()) { -- Gitblit v1.9.3