123456789101112131415161718192021222324252627282930313233343536373839 |
- package com.primeton.dgs.kernel.core.cache;
- import java.lang.annotation.ElementType;
- import java.lang.annotation.Inherited;
- import java.lang.annotation.Retention;
- import java.lang.annotation.RetentionPolicy;
- import java.lang.annotation.Target;
- /**
- * <pre>
- *
- * Created by zhaopx.
- * User: zhaopx
- * Date: 2019/9/24
- * Time: 14:27
- *
- * </pre>
- *
- * @author zhaopx
- */
- @Inherited
- @Target(ElementType.METHOD)
- @Retention(RetentionPolicy.RUNTIME)
- public @interface Cacheable {
- /**
- * 返回 缓存 Key, 支持 ${} 获取变量
- * @return 返回缓存的 Key
- */
- String key();
- /**
- * 过期时长。单位:s秒。默认永不过期,返回 0 或者 -1 永不过期
- * @return
- */
- int expire() default -1;
- }
|