AdapterApi.java 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package com.ruoyi.ucp.feign;
  2. import com.ruoyi.ucp.entity.DoubleStatData;
  3. import com.ruoyi.ucp.entity.PointData;
  4. import org.springframework.cloud.openfeign.FeignClient;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.RequestBody;
  8. import org.springframework.web.bind.annotation.RequestParam;
  9. import java.net.URI;
  10. import java.util.List;
  11. import java.util.Map;
  12. @FeignClient("adapter")
  13. public interface AdapterApi {
  14. @GetMapping("/latest2")
  15. List<PointData> getLatest2(URI baseUri, @RequestParam("keys") String keys);
  16. // @GetMapping("/latest")
  17. // Map<String, PointData> getLatest(URI baseUri, @RequestParam("keys") String keys);
  18. @PostMapping("/latests")
  19. // @Headers("Content-Type: application/json; charset=UTF-8")
  20. Map<String, PointData> getLatest(URI baseUri, @RequestBody String keys);
  21. @GetMapping("/history/snap")
  22. List<PointData> getHistorySnap(URI baseUri, @RequestParam("tagName") String tagName,
  23. @RequestParam("startTs") long startTs,
  24. @RequestParam("endTs") long endTs,
  25. @RequestParam("interval") int interval);
  26. @GetMapping("/history/raw")
  27. List<PointData> getHistoryRaw(URI baseUri, @RequestParam("tagName") String tagName,
  28. @RequestParam("startTs") long startTs,
  29. @RequestParam("endTs") long endTs);
  30. @GetMapping("/history/stat2")
  31. DoubleStatData getHistoryStat(URI baseUri, @RequestParam("tagName") String tagName,
  32. @RequestParam("startTs") long startTs,
  33. @RequestParam("endTs") long endTs);
  34. //@RequestParam("interval") int interval);
  35. @GetMapping("/history/stat")
  36. List<DoubleStatData> getHistoryStat2(URI baseUri, @RequestParam("tagName") String tagName,
  37. @RequestParam("startTs") long startTs,
  38. @RequestParam("endTs") long endTs,
  39. @RequestParam("interval") int interval);
  40. // @GetMapping("/history/section")
  41. // Map<String, PointData> getHistorySection(URI baseUri, @RequestParam("tagNames") String tagNames,
  42. // @RequestParam("ts") long ts);
  43. @PostMapping("/history/section")
  44. Map<String, PointData> getHistorySection(URI baseUri, @RequestBody String tagNames,
  45. @RequestParam("ts") long ts);
  46. @GetMapping("/history/section2")
  47. List<PointData> getHistorySection2(URI baseUri, @RequestParam("tagName") String tagName,
  48. @RequestParam("ts") long ts);
  49. // @PostMapping("/latest2")
  50. // Boolean writeHistory(URI baseUri, @RequestBody PointData tsData);
  51. //
  52. // @PostMapping("/latest2/batch")
  53. // Boolean writeHistoryBatch(URI baseUri, @RequestBody List<PointData> tsData);
  54. @PostMapping("/save")
  55. Boolean writeHistory(URI baseUri, @RequestBody PointData tsData);
  56. @PostMapping("/save/batch")
  57. Boolean writeHistoryBatch(URI baseUri, @RequestBody List<PointData> tsData);
  58. }