问题:
如何获取参数
解决:
|
@XxlJob("同步节假日") public void syncHolidayFrom() { String param = XxlJobHelper.getJobParam(); //执行参数 final String msg = "syncHolidayFrom enter.... param:" + param; log.info(msg); XxlJobHelper.log(msg); boolean = dojob(param); if (ok) { XxlJobHelper.handleSuccess(); } else { XxlJobHelper.handleFail(); } } |
参考:
https://www.xuxueli.com/xxl-job/#%E5%8E%9F%E7%94%9F%E5%86%85%E7%BD%AEBean%E6%A8%A1%E5%BC%8F%E4%BB%BB%E5%8A%A1