| | |
| | | import org.springframework.data.redis.core.*; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | import java.util.HashSet; |
| | |
| | | private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | |
| | | @PostConstruct |
| | | public void initRepository(){ |
| | | try { |
| | | this.set("test:module:Web", "testConnection", 60L, TimeUnit.SECONDS); |
| | | logger.info("[ModuleRedis][Web] is connected"); |
| | | } catch (Exception e) { |
| | | logger.error("[ModuleRedis][Web] connected failed!!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 写入缓存 |
| | | * @param key |