package com.hdkj.lt.job.task;

import com.hdkj.lt.core.sys.service.ISysStruService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component("struTreeCacheRefresh")
@RequiredArgsConstructor
public class StruTreeCacheRefreshProcessor {

    private final ISysStruService sysStruService;

    public void noParams() {
        log.info("=====组织机构树缓存刷新定时任务=====");
        long startTime = System.nanoTime();
        sysStruService.refreshStruTreeByCache();
        long endTime = System.nanoTime();
        log.info("=====组织机构树缓存刷新定时任务执行完成耗时：{}ms=====", (endTime - startTime) / 1_000_000);
    }
}
