You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
3 years ago
|
/*
|
||
|
* Copyright (C), 2018-2021
|
||
|
* Project: starter
|
||
|
* FileName: DingTalkSyncMemberJob
|
||
|
* Author: Louis
|
||
|
* Date: 2021/4/21 16:02
|
||
|
*/
|
||
|
package com.fr.plugin.xxxx.dingtalksyn.job;
|
||
|
|
||
|
import com.fanruan.api.i18n.I18nKit;
|
||
|
import com.fanruan.api.log.LogKit;
|
||
|
import com.fr.cluster.core.ClusterNode;
|
||
|
import com.fr.plugin.context.PluginContexts;
|
||
|
import com.fr.plugin.xxxx.dingtalksyn.config.DingSynConfig;
|
||
|
import com.fr.plugin.xxxx.dingtalksyn.user.DingTalkUserManager;
|
||
|
import com.fr.scheduler.job.FineScheduleJob;
|
||
|
import com.fr.third.v2.org.quartz.JobExecutionContext;
|
||
|
|
||
|
/**
|
||
|
* <Function Description><br>
|
||
|
* <DingTalkSyncMemberJob>
|
||
|
*
|
||
|
* @author fr.open
|
||
|
* @since 1.0.0
|
||
|
*/
|
||
|
public class DingTalkSyncMemberJob extends FineScheduleJob {
|
||
|
public DingTalkSyncMemberJob() {
|
||
|
}
|
||
|
|
||
|
public void run(JobExecutionContext jobExecutionContext, ClusterNode clusterNode) {
|
||
|
try {
|
||
|
if (PluginContexts.currentContext().isAvailable()) {
|
||
|
DingTalkUserManager.getInstance().synDingTalkUsers();
|
||
|
} else {
|
||
|
DingSynConfig.getInstance().setSsoEnable(false);
|
||
|
throw new Exception(I18nKit.getLocText("Plugin-dingtalksyn_Error_501"));
|
||
|
}
|
||
|
} catch (Exception e) {
|
||
|
LogKit.error(e.getMessage(), e);
|
||
|
}
|
||
|
}
|
||
|
}
|