提交 02423abb 编写于 作者: Skyeye云's avatar Skyeye云

退出删除redis信息

上级 a7b01596
......@@ -201,6 +201,10 @@ public class SysEveUserServiceImpl implements SysEveUserService{
*/
@Override
public void deleteUserMationBySession(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
jedisClient.del("userMation:" + map.get("userToken").toString());
jedisClient.del("deskTopsMation:" + map.get("userToken").toString());
jedisClient.del("allMenuMation:" + map.get("userToken").toString());
inputObject.removeSession();
}
......
package com.skyeye.jedis;
public interface JedisClient {
/**
......@@ -106,4 +107,17 @@ public interface JedisClient {
* @throws
*/
public Long hdel(String key, String... field);
/**
*
* @Title: del
* @Description: 删除给定的一个 key 不存在的 key 会被忽略。
* @param @param key
* @param @param field
* @param @return 参数
* @return Long 返回类型
* @throws
*/
public Long del(String key);
}
package com.skyeye.jedis.impl;
import org.springframework.beans.factory.annotation.Autowired;
import com.skyeye.jedis.JedisClient;
import redis.clients.jedis.JedisCluster;
public class JedisClientCluster implements JedisClient {
......@@ -55,4 +53,10 @@ public class JedisClientCluster implements JedisClient {
public Long hdel(String key, String... field) {
return jedisCluster.hdel(key, field);
}
@Override
public Long del(String key) {
return jedisCluster.del(key);
}
}
package com.skyeye.jedis.impl;
import org.springframework.beans.factory.annotation.Autowired;
import com.skyeye.jedis.JedisClient;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.util.SafeEncoder;
public class JedisClientPool implements JedisClient {
......@@ -83,4 +82,13 @@ public class JedisClientPool implements JedisClient {
jedis.close();
return result;
}
@Override
public Long del(String key) {
Jedis jedis = jedisPool.getResource();
Long result = jedis.del(SafeEncoder.encode(key));
jedis.close();
return result;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册