All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gitee.fufu669.aspect.CacheMockFetchLater Maven / Gradle / Ivy

There is a newer version: 6.666.66021
Show newest version
package com.gitee.fufu669.aspect;

import com.gitee.fufu669.common.CacheKeyCommon;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/** 首次调用没有数据就返回默认对象,自动缓存,每次调用后会后台更新缓存数据,下一次再调用就是最新的数据。 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
/** @author wangfupeng */
public @interface CacheMockFetchLater {

    /*Integer。 1.缓存没有值时抛出异常 2.缓存没有值时返回一个空对象 3.返回SimpleResponse.success()或者ListResponse.success() 其他值返回null */
    int type() default CacheKeyCommon.CACHEMOCKFETCHLATER_TYPE_DEFAULT;
    /*Integer 刷新之间的间隔秒数,默认是-1,意思是立即刷新。*/
    int refreshSeconds() default CacheKeyCommon.CACHEFETCHLATERAOP_REFRESH_EXPIRE_SECONDS;
    /*Integer redis的缓存存在最长秒数,默认是666666,约一周。*/
    int expireSeconds() default CacheKeyCommon.CACHESERVICE_REDIS_DEFAULT_EXPIRED_SECONDS_1_WEEK;
    /*在打印日志时会出现的提示*/
    String description() default "";

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy