spring boot 启动 显示

@Component
@DependsOn({"springContextHolder"})
public class StartRunner implements ApplicationRunner {
ISysSecurityLogService iSysSecurityLogService = (ISysSecurityLogService)SpringContextHolder.getBean(ISysSecurityLogService.class);
HussarCacheManager hussarCacheManager = (HussarCacheManager)SpringContextHolder.getBean(HussarCacheManager.class);

public StartRunner() {
}

public void run(ApplicationArguments args) {
int count = this.iSysSecurityLogService.selectCount(new EntityWrapper());
this.hussarCacheManager.setObject("securitylog_count", "securitylog_count", count);
}
}

https://www.cnblogs.com/baby123/p/11558816.html

ConfigListener implements ServletContextListener

AfterStartUpCommand implements CommandLineRunner
 
posted @ 2020-04-05 14:16  八方鱼  阅读(171)  评论(0)    收藏  举报