springboot初始化执行

2019-08-16  本文已影响0人  DataSource
import com.ocean.ybls.token.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Component
@Order(1) 
public class MyApplicationRunner implements ApplicationRunner {
    @Autowired
    UserService service;
    @Override
    public void run(ApplicationArguments applicationArguments){
//        System.out.println(service.findUserById(""));
    }
}

上一篇下一篇

猜你喜欢

热点阅读