package com.unis.base.server.config;

import com.unis.base.server.service.OrgainzeService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Classname OrgainzeCachePreloader
 * @Description 组织结构缓存预加载
 * @Date 2024/1/18 10:51
 * @Created by rising123sun
 */
@Component
public class OrgainzeCachePreloader implements CommandLineRunner {

    private final OrgainzeService orgainzeService;

    public OrgainzeCachePreloader(OrgainzeService orgainzeService) {
        this.orgainzeService = orgainzeService;
    }

    @Override
    public void run(String... args) throws Exception {
        orgainzeService.getOrganization();
    }
}
