package com.sky.ioc.job;

import com.sky.ioc.service.security.SecurityDeviceService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Slf4j
@Component
public class SecurityDataJob implements Job {

    @Autowired
    private SecurityDeviceService securityDeviceService;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info(String.format("同步摄像头列表数据!  时间:" + new Date()));
        securityDeviceService.syncAllCameras();
    }
}
