| | |
| | | package com.hx.redisson.manager; |
| | | |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | |
| | | import java.util.Map; |
| | |
| | | |
| | | private Map<String, RedisTemplate> redisTemplateMap = new ConcurrentHashMap<>(); |
| | | |
| | | public static Map<String, RedissonClient> redissonTemplateMap = new ConcurrentHashMap<>(); |
| | | |
| | | /** |
| | | * 构造方法初始化 redisTemplateMap 的数据 |
| | | * |
| | |
| | | public RedisManager(Map<String, RedisTemplate> redisTemplateMap) { |
| | | this.redisTemplateMap = redisTemplateMap; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据数据库序号,返回对应的RedisTemplate |
| | |
| | | return redisTemplate; |
| | | } |
| | | |
| | | |
| | | } |