package com.gyee.edge.gateway.config.cache;

import com.gyee.edge.gateway.config.point.PointMapper;
import com.gyee.edge.gateway.config.read.ReadPointCSVData;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.ArrayList;

@Component
public class PointCache {
    private ArrayList<PointMapper> strList = new ArrayList<>();

    @Value("${filePath}")
    String filePath;

    public ArrayList<PointMapper> getPointMapper(){
        if (strList.size() <= 0){
            strList = ReadPointCSVData.readConfig(filePath);
            return strList;
        }
        else
            return strList;
    }
}
