From ee9f604388a3e77d3f4654e326f3976552e7f532 Mon Sep 17 00:00:00 2001
From: Jay <csj123456>
Date: 星期一, 25 十一月 2024 13:40:07 +0800
Subject: [PATCH] 测点启用和禁用

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpApiServiceImpl.java |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpApiServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpApiServiceImpl.java
index d712f46..c6571a6 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpApiServiceImpl.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/channel/http/service/impl/HttpApiServiceImpl.java
@@ -11,12 +11,17 @@
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 @Service
 public class HttpApiServiceImpl extends ServiceImpl<HttpApiDao, HttpApiEntity> implements HttpApiService {
 
     @Resource
     private HttpApiDao httpApiDao;
+
+
+    private static Map<String, HttpApiEntity> idMap = new ConcurrentHashMap<>();
 
     @Override
     public PageResult<HttpApiEntity> queryPage(HttpApiPageReqVO reqVO) {
@@ -49,6 +54,19 @@
     }
 
     @Override
+    public HttpApiEntity getFromCatch(String id) {
+        if (idMap.containsKey(id)) {
+            return idMap.get(id);
+        }
+        HttpApiEntity entity = httpApiDao.selectById(id);
+        if (entity == null) {
+            return null;
+        }
+        idMap.put(id, entity);
+        return idMap.get(id);
+    }
+
+    @Override
     public List<HttpApiEntity> list() {
         return httpApiDao.selectList(new QueryWrapper<>());
     }

--
Gitblit v1.9.3