package com.gyee.runeconomy.util.realtimesource.feign;


import com.gyee.common.model.PointData;
import feign.Headers;
import feign.Param;
import feign.RequestLine;

import java.util.List;

/**
 * DataAdapter数据请求
 */
public interface IDataAdapter {
    /**
     * 获取等间隔历史数据
     *
     * @param tagName  测点名称
     * @param startTs  开始时间
     * @param endTs    结束时间
     * @param interval 数据间隔
     * @return 历史数据
     */
    @RequestLine("GET /history/snap?tagName={tagName}&startTs={startTs}&endTs={endTs}&interval={interval}")
    List<PointData> getSnapValuesByKey(@Param(value = "tagName") String tagName, @Param(value = "startTs") long startTs,
                                       @Param(value = "endTs") long endTs, @Param(value = "interval") int interval);

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("GET /history/snap?tagName={tagName}&startTs={startTs}&endTs={endTs}&interval={interval}")
    List<TsDoubleTsData> getHistorySnap(@Param(value = "tagName") String tagName, @Param(value = "startTs") long startTs,
                                        @Param(value = "endTs") long endTs, @Param(value = "interval") Integer interval);
}

