package com.yida.data.job.task;

import com.yida.data.user.feign.RemoteStaffService;
import com.yida.data.user.feign.RemoteStudentService;
import com.yida.data.user.feign.RemoteUserDeptService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 用户模块相关定时任务
 *
 * @author ZYJ
 * @date 2021/11/30
 */
@Component
@AllArgsConstructor
public class UserTask {

    private final RemoteStudentService remoteStudentService;
    private final RemoteStaffService remoteStaffService;
    private final RemoteUserDeptService remoteUserDeptService;

    /**
     * 同步企业微信学生信息
     */
    public void syncQywxStudent() {
        remoteStudentService.syncQywxStudent();
    }

    /**
     * 同步企业微信职工信息
     */
    public void syncQywxStaff() {
        remoteStaffService.syncQywxStaff();
    }

    /**
     * 同步企业微信家校部门
     */
    public void syncUserDept() {
        remoteUserDeptService.syncUserDept();
    }

    /**
     * 处理挂在学校下的家校部门
     */
    public void dealNoParentUserDept() {
        remoteUserDeptService.dealNoParentUserDept();
    }


    /**
     * 定时更新学生数据缓存
     */
    public void updateStudentCache() {
        remoteStudentService.updateStudentCache();
    }


    /**
     * 定时更新教职工数据缓存
     */
    public void updateStaffCache() {
        remoteStaffService.updateStaffCache();
    }

}
