From f635f9c3003ae10f7be8e934b81bc480c82617ba Mon Sep 17 00:00:00 2001 From: xiaoxie <hotcoffie@163.com> Date: 星期三, 20 四月 2022 13:56:30 +0800 Subject: [PATCH] 修复录像列表:实测部分厂家(TP-Link IPC43AW)录像列表接口,返回的xml报文数据中有多余的空格,导致解析String为Integer失败,增加trim修复这个问题 --- src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java b/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java index f89b30d..8ab0672 100644 --- a/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java @@ -3,6 +3,7 @@ import java.util.*; import java.util.concurrent.TimeUnit; +import com.alibaba.fastjson.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.*; import org.springframework.stereotype.Component; @@ -660,6 +661,24 @@ } /** + * 鍦ㄩ敭涓� key 鐨� list涓Щ闄ょ涓�涓厓绱� + * @param key 閿� + * @return + */ + public Object lLeftPop(String key) { + return redisTemplate.opsForList().leftPop(key); + } + + /** + * 鍦ㄩ敭涓� key 鐨� list涓Щ闄ゃ�佹渶鍚庝竴涓厓绱� + * @param key 閿� + * @return + */ + public Object lrightPop(String key) { + return redisTemplate.opsForList().rightPop(key); + } + + /** * 妯$硦鏌ヨ * @param key 閿� * @return true / false @@ -730,7 +749,8 @@ } // ============================== 娑堟伅鍙戦�佷笌璁㈤槄 ============================== - public void convertAndSend(String channel, String msg) { + public void convertAndSend(String channel, JSONObject msg) { +// redisTemplate.convertAndSend(channel, msg); redisTemplate.convertAndSend(channel, msg); } -- Gitblit v1.8.0