springboot自定义启动类

import com.ax.service.pay.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @ClassName MyApplicationRunner
 * @Description 系统启动类,Application启动之后开始执行run方法
 * @Date 2019/12/23 16:02
 **/
@Component
public class MyApplicationRunner implements ApplicationRunner {
    @Autowired
    private OrderService orderService;

    /**
     * @Description 自动执行方法
     * @Date 2019/12/12 16:05
     * @Param [var]
     * @Return void
     **/
    @Override
    public void run(ApplicationArguments var){
        //  业务代码  
     // ...
    }
}

 

posted @ 2019-12-24 10:00  幻月hah  阅读(1422)  评论(0编辑  收藏  举报