package com.qmth.distributed.print.start; import com.qmth.teachcloud.common.service.AuthInfoService; import com.qmth.teachcloud.common.service.SysConfigService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; import javax.annotation.Resource; /** * @Description: 服务启动时初始化运行,哪个微服务模块需要则拿此模版去用 * @Param: * @return: * @Author: wangliang * @Date: 2020/7/3 */ @Component public class StartRunning implements CommandLineRunner { private final static Logger log = LoggerFactory.getLogger(StartRunning.class); @Resource AuthInfoService authInfoService; @Resource SysConfigService sysConfigService; @Override public void run(String... args) throws Exception { log.info("服务器启动时执行 start"); sysConfigService.selectAll(); authInfoService.appInfoInit(); log.info("服务器启动时执行 end"); } }