package com.gyee.wisdom.backwork;

import com.gyee.wisdom.domain.timeseries.TsPointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;


@Component
public class BackWorkStart implements ApplicationRunner {

    @Value("${isLoadAllTag:false}")
    private String isLoadAllWindturbineTag;


    @Autowired
    private TsPointService tsPointService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        //缓存view_tspoint测点
        if(Boolean.valueOf(isLoadAllWindturbineTag)){
            tsPointService.getAllTsPointToCache();
        }


    }


}
