docs(quartz): 更新定时任务相关类的文档注释

This commit is contained in:
2026-02-26 13:42:57 +08:00
parent 140d39cbe6
commit 643a211f95
8 changed files with 49 additions and 2 deletions
@@ -16,14 +16,18 @@
package cn.odboy.framework.quartz.core;
import cn.odboy.framework.context.KitSpringBeanHolder;
import java.lang.reflect.Method;
import java.util.concurrent.Callable;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.ReflectionUtils;
/**
* 执行定时任务
* 带返回值的线程
*
* @author odboy
*/
@Slf4j
public class QuartzRunnable implements Callable<Object> {
@@ -22,8 +22,14 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 应用初始化完毕后,注册定时任务
*
* @author odboy
*/
@Slf4j
@Component
public class ActiveJobRegister implements ApplicationRunner {
@@ -35,12 +35,18 @@ import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.scheduling.quartz.QuartzJobBean;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;
/**
* 任务定义,继承QuartzJobBean是固定写法
*
* @author odboy
*/
@Slf4j
public class ExecutionJobBean extends QuartzJobBean {
@@ -32,8 +32,14 @@ import org.quartz.TriggerBuilder;
import org.quartz.TriggerKey;
import org.quartz.impl.triggers.CronTriggerImpl;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 定时任务管理工具(高耦合版)
*
* @author odboy
*/
@Slf4j
@Component
public class QuartzManage {
@@ -16,14 +16,18 @@
package cn.odboy.framework.quartz.core;
import cn.odboy.framework.context.KitSpringBeanHolder;
import java.lang.reflect.Method;
import java.util.concurrent.Callable;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.ReflectionUtils;
/**
* 执行定时任务
* 带返回值的线程
*
* @author odboy
*/
@Slf4j
public class QuartzRunnable implements Callable<Object> {
@@ -17,13 +17,20 @@ package cn.odboy.system.framework.quartz;
import cn.odboy.system.dal.dataobject.SystemQuartzJobTb;
import cn.odboy.system.service.SystemQuartzJobService;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;
/**
* 应用初始化完毕后,注册定时任务
*
* @author odboy
*/
@Slf4j
@Component
public class ActiveJobRegister implements ApplicationRunner {
@@ -31,16 +31,23 @@ import cn.odboy.system.dal.mysql.SystemQuartzLogMapper;
import cn.odboy.system.service.SystemEmailService;
import cn.odboy.system.service.SystemQuartzJobService;
import cn.odboy.util.KitBeanUtil;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.scheduling.quartz.QuartzJobBean;
/**
* 任务定义,继承QuartzJobBean是固定写法
*
* @author odboy
*/
@Slf4j
public class ExecutionJobBean extends QuartzJobBean {
@@ -17,8 +17,10 @@ package cn.odboy.system.framework.quartz;
import cn.odboy.framework.exception.BadRequestException;
import cn.odboy.system.dal.dataobject.SystemQuartzJobTb;
import java.util.Date;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.quartz.CronScheduleBuilder;
import org.quartz.CronTrigger;
@@ -34,6 +36,11 @@ import org.quartz.TriggerKey;
import org.quartz.impl.triggers.CronTriggerImpl;
import org.springframework.stereotype.Component;
/**
* 定时任务管理工具(高耦合版)
*
* @author odboy
*/
@Slf4j
@Component
public class QuartzManage {