package com.gyee.frame.common.feign;

import com.alibaba.fastjson.JSONObject;
import com.gyee.frame.common.domain.AjaxResult;
import com.gyee.frame.model.custom.export.TsPointData;
import feign.Headers;
import feign.Param;
import feign.RequestLine;

import java.util.List;


public interface IAdapterService {


    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("GET /ts/latest?keys={points}")
    JSONObject getLatest(@Param(value = "points") String points);


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

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("GET /ts/history/raw?tagName={tagName}&startTs={startTs}&endTs={endTs}")
    List<TsPointData> getHistoryRaw(@Param(value = "tagName") String tagName, @Param(value = "startTs") long startTs,
                                     @Param(value = "endTs") long endTs);

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("GET /ts/history/section?tagNames={tagNames}&ts={ts}")
    List<TsPointData> getHistorySection(@Param(value = "tagNames") String tagNames, @Param(value = "ts") long ts);

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("GET /alarm/count/query/new2?stationid={stationid}&startdate={startdate}&enddate={enddate}")
     AjaxResult getEarlyWarning(@Param(value = "stationid") String stationid, @Param(value = "startdate") String startdate,
                                        @Param(value = "enddate") String enddate);

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("GET /shutdown/list?stId={stId}&endDate={endDate}&startDate={startDate}")
    AjaxResult getHith(@Param(value = "stId") String stId, @Param(value = "endDate") String endDate,
                                    @Param(value = "startDate") String startDate);

    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @RequestLine("GET /alarm/history/page2?pagenum={pagenum}&pagesize={pagesize}&stationid={stationid}&windturbineid={windturbineid}" +
            "&category1={category1}&category2={category2}&rank={rank}&modelid={modelid}&snapid={snapid}&messagetype={messagetype}" +
            "&keyword={keyword}&starttime={starttime}&endtime={endtime}")
    AjaxResult getPage(@Param(value = "pagenum") Integer pagenum, @Param(value = "pagesize") Integer pagesize,
                                    @Param(value = "stationid") String stationid,
                                    @Param(value = "windturbineid") String windturbineid,
                                    @Param(value = "category1") String category1,
                                    @Param(value = "category2") String category2,
                                    @Param(value = "rank") String rank,
                                    @Param(value = "modelid") String modelid,
                                    @Param(value = "snapid") Long snapid,
                                    @Param(value = "messagetype") Integer messagetype,
                                    @Param(value = "keyword") String keyword,
                                    @Param(value = "starttime") String starttime,
                                    @Param(value = "endtime") String endtime);
}
