| package com.xzx.gc.listener;  | 
|   | 
| import lombok.extern.slf4j.Slf4j;  | 
| import org.springframework.beans.factory.annotation.Autowired;  | 
| import org.springframework.data.redis.connection.Message;  | 
| import org.springframework.data.redis.connection.MessageListener;  | 
| import org.springframework.data.redis.core.RedisTemplate;  | 
| import org.springframework.stereotype.Component;  | 
|    | 
| @Component  | 
| @Slf4j  | 
| public class RedisMessageListener implements MessageListener {  | 
|    | 
|    | 
|     @Autowired  | 
|     private RedisTemplate<String, String> redisTemplate;  | 
|    | 
|     @Override  | 
|     public void onMessage(Message message, byte[] pattern) {  | 
|         String str = (String) redisTemplate.getValueSerializer().deserialize(message.getBody());  | 
|         if(!str.startsWith("xzx:user:signNonce")) {  | 
|             log.trace("REDIS键:{} 已过期", str);  | 
|         }  | 
|   | 
|   | 
|         // redisUtil.setex(Constants.REDIS_USER_KEY+"token:"+userInfoVo.getUserId(),token,TokenUtil.TIME);  | 
|   | 
| //        String key= Constants.REDIS_USER_KEY+"token:";  | 
| //        if(str.startsWith(key)){  | 
| //            String userId= StrUtil.subAfter(str,key,true);  | 
| //  | 
| //        }  | 
|     }  | 
|    | 
|    | 
| } |