package cn.hnthyy.thmz;

import cn.hnthyy.thmz.service.thmz.DiscountService;
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;

/**
 * 服务启动成功后立即执行的功能
 */
@Component
@Slf4j
public class MyApplicationRunner implements ApplicationRunner {
    @Autowired
    private DiscountService discountService;
    @Override
    public void run(ApplicationArguments var1) throws Exception{
        discountService.getCacheMap();
        log.info("初始化营销方案缓存成功");
    }
}
