From c3c49a05c2aa34748f7bfc0011a68ddf9239c4e4 Mon Sep 17 00:00:00 2001 From: XCSDN <gitee@xcsdn.net> Date: 星期六, 16 四月 2022 14:02:07 +0800 Subject: [PATCH] 新增一个取文件名而不带后缀的整合方法,干净又卫生啊兄弟们 --- ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java index 37fe72e..6712a72 100644 --- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java +++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java @@ -10,9 +10,11 @@ import org.quartz.SchedulerException; import org.quartz.TriggerBuilder; import org.quartz.TriggerKey; +import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.ScheduleConstants; import com.ruoyi.common.exception.job.TaskException; import com.ruoyi.common.exception.job.TaskException.Code; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.quartz.domain.SysJob; /** @@ -110,4 +112,21 @@ + "' cannot be used in cron schedule tasks", Code.CONFIG_ERROR); } } + + /** + * 妫�鏌ュ寘鍚嶆槸鍚︿负鐧藉悕鍗曢厤缃� + * + * @param invokeTarget 鐩爣瀛楃涓� + * @return 缁撴灉 + */ + public static boolean whiteList(String invokeTarget) + { + String packageName = StringUtils.substringBefore(invokeTarget, "("); + int count = StringUtils.countMatches(packageName, "."); + if (count > 1) + { + return StringUtils.containsAnyIgnoreCase(invokeTarget, Constants.JOB_WHITELIST_STR); + } + return true; + } } -- Gitblit v1.9.3