package com.yeejoin.amos.boot.module.jxiop.biz.scheduled;

import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TemporaryDataMapper;
import com.yeejoin.amos.boot.module.jxiop.biz.repository.ESWindSpeedRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@EnableScheduling
public class WindSpeedScheduled {



    @Autowired
    TemporaryDataMapper temporaryDataMapper;
    @Autowired
    ESWindSpeedRepository esWindSpeedRepository;

    @Scheduled(cron="${windSpeed.cron}")
    private void initData(){
        esWindSpeedRepository.saveAll(temporaryDataMapper.getAllData());
    }


}
