package com.hzs.bonus.component.load;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @Description: 服务器启动时将配置信息加载到redis缓存
 * @Author: sui q
 * @Time: 2022/9/6 17:48
 * @Classname: LoadRunner
 * @PackageName: com.hzs.system.component.load
 */
@Component
@Slf4j
public class MemberLoadRunner implements ApplicationRunner {

    private RedisComponent redisComponent;

    @Autowired
    public void setRedisComponent(RedisComponent redisComponent) {
        this.redisComponent = redisComponent;
    }

    @Override
    public void run(ApplicationArguments args) {
        // 初始化member服务的系统参数
        redisComponent.initConfig();
    }

}
