package com.sckw.example.task;

import com.sckw.example.service.TestXxlJobService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @desc: xxl-job测试
 * @author: yzc
 * @date: 2023-06-15 11:23
 */
@Component
@Slf4j
@RequiredArgsConstructor
public class TestXxlJobTask {

    private final TestXxlJobService testXxlJobService;

    @XxlJob("TestXxlJobTask")
    public void process(){
        String param = XxlJobHelper.getJobParam();
        log.info("xxl-job测试任务开始...month:{}", param);
        testXxlJobService.test(param);
        log.info("xxl-job测试任务结束...month:{}", param);
    }

}
