package cn.iocoder.yudao.module.system.job;

import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.system.api.wechat.CorpWechatApi;
import cn.iocoder.yudao.module.system.enums.device.SleepthingApiConstants;
import cn.iocoder.yudao.module.system.service.biz.SleepthingService;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.HashMap;

@Component
@Slf4j
public class CorpWechatSyncIdJob implements JobHandler {

    private final static Logger logger = LoggerFactory.getLogger(CorpWechatSyncIdJob.class);

    @Resource
    private CorpWechatApi corpWechatApi;

    @Override
    @TenantJob
    public String execute(String param) {

        Integer syncCount = corpWechatApi.syncCorpUserId();

        return String.format("租户{}同步用户的企微id数量{}", TenantContextHolder.getTenantId(), syncCount);
    }

}
