From 9100b0c14dca46366cfe79336eb85d5f0ca793af Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期四, 10 十月 2024 08:55:24 +0800
Subject: [PATCH] IndItemController

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/IndItemController.java |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/DataController.java    |    2 ++
 2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/DataController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/DataController.java
index bc0bdf7..1bb4e80 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/DataController.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/DataController.java
@@ -22,6 +22,7 @@
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.security.PermitAll;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
@@ -56,6 +57,7 @@
     @Resource
     private PointCollector pointCollector;
 
+    @PermitAll
     @PostMapping("/point/history")
     @Operation(summary = "point历史数据")
     public CommonResult<Map<String, List<Map<String, Object>>>> pointHistory(HttpServletResponse response, HttpServletRequest
diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/IndItemController.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/IndItemController.java
new file mode 100644
index 0000000..bbc9c15
--- /dev/null
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/api/controller/IndItemController.java
@@ -0,0 +1,53 @@
+package com.iailab.module.data.api.controller;
+
+import com.iailab.framework.common.pojo.CommonResult;
+import com.iailab.framework.common.util.object.ConvertUtils;
+import com.iailab.module.data.api.ind.dto.ApiIndItemQueryDTO;
+import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO;
+import com.iailab.module.data.ind.collection.IndItemCollector;
+import com.iailab.module.data.ind.item.vo.IndItemValueVO;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.security.PermitAll;
+import java.util.List;
+
+import static com.iailab.framework.common.pojo.CommonResult.success;
+
+/**
+ * @author PanZhibao
+ * @Description
+ * @createTime 2024年10月10日
+ */
+@Slf4j
+@RestController
+@RequestMapping("/api/data/ind-item")
+@Tag(name = "指标")
+public class IndItemController {
+
+    @Autowired
+    private IndItemCollector indItemCollector;
+
+    @PermitAll
+    @GetMapping("/query-ind/default-value")
+    @Operation(summary = "查询指标默认值")
+    public CommonResult<List<ApiIndItemValueDTO>> queryIndItemDefaultValue(@RequestParam String itemNo) {
+        List<IndItemValueVO> list = indItemCollector.queryValue(itemNo);
+        return success(ConvertUtils.sourceToTarget(list, ApiIndItemValueDTO.class));
+
+    }
+
+    @PermitAll
+    @GetMapping("/query-ind/history-value")
+    @Operation(summary = "查询指标历史值")
+    public CommonResult<List<ApiIndItemValueDTO>> queryIndItemHistoryValue(@RequestParam ApiIndItemQueryDTO dto) {
+        List<IndItemValueVO> list = indItemCollector.queryValue(dto.getItemNo(), dto.getStart(), dto.getEnd());
+        return success(ConvertUtils.sourceToTarget(list, ApiIndItemValueDTO.class));
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.3