在调度的类上加上如下注解:
@PropertySource(name="application.yml",value= {"classpath:application.yml"},ignoreResourceNotFound=false,encoding="UTF-8")
在配置文件中加入如下代码:
jobs: handleUnhandleOfCup: 0 28 14 * * ?
在具体执行的方法上加上如下代码:
@Scheduled(cron = "${jobs.handleUnhandleOfCup}")
项目截图如下: