类 ReactiveRedisService


  • public class ReactiveRedisService
    extends Object
    作者:
    youta
    • 字段详细资料

      • redisTemplate

        @Autowired
        private org.springframework.data.redis.core.ReactiveRedisTemplate<String,​Object> redisTemplate
    • 构造器详细资料

      • ReactiveRedisService

        public ReactiveRedisService()
    • 方法详细资料

      • expire

        public reactor.core.publisher.Mono<Boolean> expire​(String key,
                                                           java.time.Duration timeout)
        指定缓存失效时间
        参数:
        key - 键
        timeout - 时间(秒)
        返回:
        Boolean
      • hasKey

        public reactor.core.publisher.Mono<Boolean> hasKey​(String key)
        判断 key是否存在
        参数:
        key - 键
        返回:
        true 存在 false不存在
      • del

        public reactor.core.publisher.Mono<Long> del​(String key)
        删除缓存
        参数:
        key -
      • get

        public reactor.core.publisher.Mono<Object> get​(String key)
        普通缓存获取
        参数:
        key - 键
        返回:
      • set

        public reactor.core.publisher.Mono<Boolean> set​(String key,
                                                        Object value)
        普通缓存放入
        参数:
        key - 键
        value - 值
        返回:
        true成功 false失败
      • set

        public reactor.core.publisher.Mono<Boolean> set​(String key,
                                                        Object value,
                                                        java.time.Duration time)
        普通缓存放入并设置时间
        参数:
        key - 键
        value - 值
        time - 时间
        返回:
        true成功 false 失败
      • hashGet

        public reactor.core.publisher.Mono<Object> hashGet​(String key,
                                                           String item)
        HashGet
        参数:
        key - 键 不能为 null
        item - 项 不能为 null
        返回:
      • hashSet

        public reactor.core.publisher.Mono<Boolean> hashSet​(String key,
                                                            Map<String,​Object> map)
        HashSet
        参数:
        key - 键
        map - 对应多个键值
        返回:
        true 成功 false 失败
      • hashSet

        public reactor.core.publisher.Mono<Boolean> hashSet​(String key,
                                                            Map<String,​Object> map,
                                                            java.time.Duration time)
        HashSet 并设置时间
        参数:
        key - 键
        map - 对应多个键值
        time - 时间(秒)
        返回:
        true成功 false失败
      • hmget

        public reactor.core.publisher.Flux<Map.Entry<Object,​Object>> hmget​(String key)
        获取 hashKey对应的所有键值
        参数:
        key - 键
        返回:
        对应的多个键值