|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | import org.springframework.util.CollectionUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @Description:Redis工具类 | 
|---|
|  |  |  | * @description:Redis工具类 | 
|---|
|  |  |  | * @author: swwheihei | 
|---|
|  |  |  | * @date:   2020年5月6日 下午8:27:29 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 
|---|
|  |  |  | return new ArrayList<>(keys); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //    ============================== 消息发送与订阅 ============================== | 
|---|
|  |  |  | public void convertAndSend(String channel, JSONObject msg) { | 
|---|
|  |  |  | //        redisTemplate.convertAndSend(channel, msg); | 
|---|
|  |  |  | redisTemplate.convertAndSend(channel, msg); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|