package com.xhkjedu.sapi.task;

import com.xhkjedu.sapi.config.ConfigKey;
import com.xhkjedu.sapi.model.cloud.TCloudSync;
import com.xhkjedu.sapi.service.cloud.CloudSyncService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author ywx
 * @className CloudSyncTask
 * @description
 * @date 2021/6/5 14:13
 **/
@Component
public class CloudSyncTask {
    @Resource
    private CloudSyncService cloudSyncService;

    //生成上周班级报告
    @Scheduled(cron = "${cron.synctime}")
    public void classReportWeek(){
        TCloudSync sync = cloudSyncService.getCloudInfo();
        sync.setSyncnum(ConfigKey.syncnum);
        cloudSyncService.sync(sync);
    }
}
