package com.ruoyi.ucp.feign; import com.ruoyi.ucp.entity.DoubleStatData; import com.ruoyi.ucp.entity.PointData; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.net.URI; import java.util.List; import java.util.Map; @FeignClient("adapter") public interface AdapterApi { @GetMapping("/latest2") List getLatest2(URI baseUri, @RequestParam("keys") String keys); // @GetMapping("/latest") // Map getLatest(URI baseUri, @RequestParam("keys") String keys); @PostMapping("/latests") // @Headers("Content-Type: application/json; charset=UTF-8") Map getLatest(URI baseUri, @RequestBody String keys); @GetMapping("/history/snap") List getHistorySnap(URI baseUri, @RequestParam("tagName") String tagName, @RequestParam("startTs") long startTs, @RequestParam("endTs") long endTs, @RequestParam("interval") int interval); @GetMapping("/history/raw") List getHistoryRaw(URI baseUri, @RequestParam("tagName") String tagName, @RequestParam("startTs") long startTs, @RequestParam("endTs") long endTs); @GetMapping("/history/stat2") DoubleStatData getHistoryStat(URI baseUri, @RequestParam("tagName") String tagName, @RequestParam("startTs") long startTs, @RequestParam("endTs") long endTs); //@RequestParam("interval") int interval); @GetMapping("/history/stat") List getHistoryStat2(URI baseUri, @RequestParam("tagName") String tagName, @RequestParam("startTs") long startTs, @RequestParam("endTs") long endTs, @RequestParam("interval") int interval); // @GetMapping("/history/section") // Map getHistorySection(URI baseUri, @RequestParam("tagNames") String tagNames, // @RequestParam("ts") long ts); @PostMapping("/history/section") Map getHistorySection(URI baseUri, @RequestBody String tagNames, @RequestParam("ts") long ts); @GetMapping("/history/section2") List getHistorySection2(URI baseUri, @RequestParam("tagName") String tagName, @RequestParam("ts") long ts); // @PostMapping("/latest2") // Boolean writeHistory(URI baseUri, @RequestBody PointData tsData); // // @PostMapping("/latest2/batch") // Boolean writeHistoryBatch(URI baseUri, @RequestBody List tsData); @PostMapping("/save") Boolean writeHistory(URI baseUri, @RequestBody PointData tsData); @PostMapping("/save/batch") Boolean writeHistoryBatch(URI baseUri, @RequestBody List tsData); }