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

import com.gyee.edge.gateway.client.EndPoint;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class CacheService {

    private List<EndPoint> endPointList;

    public List<EndPoint> getEndPointList() {
        if (endPointList == null) {
            endPointList = loadEndPoints();
        }

        return endPointList;
    }

    private List<EndPoint> loadEndPoints() {
        //todo: 从数据库中加载endpoint
        return new ArrayList<>();
    }


}
