springboot初始化执行
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(""));
}
}
本文标题:springboot初始化执行
本文链接:https://www.haomeiwen.com/subject/yxqfsctx.html
网友评论