OrgRunner.java 622 Bytes
package vion.cron;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import vion.third.DingMod;

/**
 * @author vion
 * @date 2023/11/30
 */
@Component
@Slf4j
@RequiredArgsConstructor
public class OrgRunner {

    private final DingMod dingMod;

    @Scheduled(cron = "0 1 2 * * ?")
    public void syncOrg() {
        log.info("钉钉组织关系同步启动");
        dingMod.getDeptList();
        dingMod.getDingUserList();
        log.info("钉钉组织关系同步完成");
    }
}