package ink.wgink.login.base.startup;

import ink.wgink.login.base.dao.config.IConfigDao;
import ink.wgink.login.base.manager.ConfigManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: LoginBaseStartUp
 * @Description: 登录
 * @Author: WangGeng
 * @Date: 2021/2/25 21:31
 * @Version: 1.0
 **/
@Component
public class LoginBaseStartUp implements ApplicationRunner {

    private static final Logger LOG = LoggerFactory.getLogger(LoginBaseStartUp.class);
    @Autowired
    private IConfigDao configDao;


    @Override
    public void run(ApplicationArguments args) throws Exception {
        LOG.debug(">>>>>> 初始化配置");
        ConfigManager configManager = ConfigManager.getInstance();
        configManager.setConfigDao(configDao);
    }

}
