浏览代码

openfeign调用适配器,基础信息查询(场站查询)

malijun 1 年之前
父节点
当前提交
0841acbe6b
共有 1 个文件被更改,包括 29 次插入0 次删除
  1. 29 0
      electricity/meter/src/main/java/com/gyee/gaia/meter/adapter/Adapter.java

+ 29 - 0
electricity/meter/src/main/java/com/gyee/gaia/meter/adapter/Adapter.java

@@ -0,0 +1,29 @@
+package com.gyee.gaia.meter.adapter;
+
+import com.gyee.gaia.meter.entity.PointData;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Author: malijun
+ * Data  : 2023: 04: 27
+ **/
+@FeignClient(name="adapter",url = "192.168.10.18:8011/ts")
+public interface Adapter {
+
+
+    //获取一个或多个测点,指定时间的数据(没有则返回前一个时间点的数据)
+    @GetMapping("/history/section")
+    Map<String, PointData> getHistorySection(
+            @RequestParam(value = "tagNames", required = false) String tagNames,
+            @RequestParam(value = "ts", required = false) Long ts
+    );
+
+    //获取一个测点,指定时间段内的所有数据
+//    List<PointData> getHistoryRaw();
+
+}