com.ideaaedi.extspringcache.annotation.Redis Maven / Gradle / Ivy
The newest version!
package com.ideaaedi.extspringcache.annotation;
import com.ideaaedi.extspringcache.enums.RedisExpireStrategyEnum;
import org.springframework.data.redis.core.RedisTemplate;
import java.time.temporal.ChronoUnit;
/**
* redis缓存相关信息
*
* @author JustryDeng
* @since 2020/11/4 14:50:29
*/
public @interface Redis {
/** a spring-bean name who type of {@link RedisTemplate}. of curse, including its sub-classes. */
String useRedisTemplate() default "redisTemplate";
/** expire-time (cannot be negative or zero) */
int expireTime() default 30;
/** unit for {@link Redis#expireTime()} */
ChronoUnit timeUnit() default ChronoUnit.SECONDS;
/** strategy for {@link Redis#expireTime()} */
RedisExpireStrategyEnum expireStrategy() default RedisExpireStrategyEnum.AUTO;
}