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 | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 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 d92d201..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) { @@ -44,13 +49,21 @@ } @Override - public HttpApiEntity selectXstHttpTagApi() { - return httpApiDao.selectOne(new QueryWrapper<HttpApiEntity>().eq("code","xstHttpTag")); + public HttpApiEntity getByCode(String code) { + return httpApiDao.selectOne(new QueryWrapper<HttpApiEntity>().eq("code", code)); } @Override - public HttpApiEntity getByCode(String code) { - return httpApiDao.selectOne(new QueryWrapper<HttpApiEntity>().eq("code", code)); + 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 -- Gitblit v1.9.3