Commit 0d69cf0a authored by alex yao's avatar alex yao

fix:NPE

parent 2f4aa601
...@@ -16,7 +16,7 @@ public class LongMemory { ...@@ -16,7 +16,7 @@ public class LongMemory {
RedisService redisService = SpringUtils.getBean(RedisService.class); RedisService redisService = SpringUtils.getBean(RedisService.class);
List<AgentLongMemoryEntity> result = new ArrayList<>(); List<AgentLongMemoryEntity> result = new ArrayList<>();
// 查询用户相关信息(什么内容都可以) // 查询用户相关信息(什么内容都可以)
String contentKey = SetLongMemoryConstants.REDIS_PREFIX + identifier + ":" + BlContext.getCurrentUserNotException().getUserId().toString(); String contentKey = SetLongMemoryConstants.REDIS_PREFIX + identifier ;
Map<Object, Object> map = redisService.hmget(contentKey); Map<Object, Object> map = redisService.hmget(contentKey);
Set<Object> keySet = map.keySet(); Set<Object> keySet = map.keySet();
...@@ -37,7 +37,7 @@ public class LongMemory { ...@@ -37,7 +37,7 @@ public class LongMemory {
public static void clean(String agentId) { public static void clean(String agentId) {
RedisService redisService = SpringUtils.getBean(RedisService.class); RedisService redisService = SpringUtils.getBean(RedisService.class);
String key = AgentApplicationTools.identifier(agentId, agentId); String key = AgentApplicationTools.identifier(agentId, agentId);
String contentKey = SetLongMemoryConstants.REDIS_PREFIX + key + ":" + BlContext.getCurrentUserNotException().getUserId().toString(); String contentKey = SetLongMemoryConstants.REDIS_PREFIX + key ;
redisService.del(contentKey); redisService.del(contentKey);
} }
...@@ -50,7 +50,7 @@ public class LongMemory { ...@@ -50,7 +50,7 @@ public class LongMemory {
public static void delByKey(String agentId, String item) { public static void delByKey(String agentId, String item) {
RedisService redisService = SpringUtils.getBean(RedisService.class); RedisService redisService = SpringUtils.getBean(RedisService.class);
String key = AgentApplicationTools.identifier(agentId, agentId); String key = AgentApplicationTools.identifier(agentId, agentId);
String contentKey = SetLongMemoryConstants.REDIS_PREFIX + key + ":" + BlContext.getCurrentUserNotException().getUserId().toString(); String contentKey = SetLongMemoryConstants.REDIS_PREFIX + key ;
redisService.hdel(contentKey, item); redisService.hdel(contentKey, item);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment