package com.njcn.executor.handler;

import com.njcn.user.api.UserFeignClient;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;


/**
 * @author hongawen
 * @version 1.0.0
 * @date 2022年03月22日 16:44
 */
@Slf4j
@Component
@AllArgsConstructor
public class TestJob {

    private final UserFeignClient userFeignClient;


    /**
     * 1、简单任务示例（Bean模式）
     */
    @XxlJob("demoJobHandler")
    public void demoJobHandler() {
        String command = XxlJobHelper.getJobParam();
        System.out.println("前台传递的参数：" + command);
//        HttpResult<UserDTO> root = userFeignClient.getUserByName("root");
//        log.error(root.getData().toString());
//        System.out.println(root);
    }
}
