package com.moral.api.jobHandler; import org.springframework.stereotype.Component; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.context.XxlJobHelper; import com.xxl.job.core.handler.annotation.XxlJob; @Component public class TestHandler{ @XxlJob("testJobHandler") public ReturnT execute(){ //执行器传参 String param = XxlJobHelper.getJobParam(); System.out.println(param); System.out.println("定时任务测试"); return ReturnT.SUCCESS; } }