package com.testor.module.demo.job;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author zhangyangfan@testor.com.cn
 * @version 1.0
 * @description: TODO
 * @date 2022/5/18 16:54
 */
@Component
@Slf4j
public class XxlJobDemo extends IJobHandler {

    @XxlJob("demoJobHandler")
    public ReturnT<String> execute(String param) throws Exception {
        System.out.println("demoJobHandler 任务执行" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        return ReturnT.SUCCESS;
    }

    @Override
    public void execute() throws Exception {

    }
}
