mirror of
https://github.com/dromara/tianai-captcha.git
synced 2026-05-11 08:24:05 +08:00
1.5.0重构;
修复一大堆已知问题, 优化代码, 增加 application 类, 重构拦截器组件, 添加缓存模块,
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
package cloud.tianai.captcha.cache;
|
||||
|
||||
import cloud.tianai.captcha.common.AnyMap;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Author: 天爱有情
|
||||
* @date 2022/3/2 14:35
|
||||
* @Description 提取出用于缓存的接口
|
||||
*/
|
||||
public interface CacheStore {
|
||||
|
||||
/**
|
||||
* 读取缓存数据通过key
|
||||
*
|
||||
* @param key key
|
||||
* @return AnyMap
|
||||
*/
|
||||
AnyMap getCache(String key);
|
||||
|
||||
/**
|
||||
* 获取并删除数据 通过key
|
||||
*
|
||||
* @param key key
|
||||
* @return AnyMap
|
||||
*/
|
||||
AnyMap getAndRemoveCache(String key);
|
||||
|
||||
/**
|
||||
* 添加缓存数据
|
||||
*
|
||||
* @param key key
|
||||
* @param data data
|
||||
* @param expire 过期时间
|
||||
* @param timeUnit 过期时间单位
|
||||
* @return boolean
|
||||
*/
|
||||
boolean setCache(String key, AnyMap data, Long expire, TimeUnit timeUnit);
|
||||
|
||||
|
||||
/**
|
||||
* incr 数字
|
||||
*
|
||||
* @param key key
|
||||
* @param delta 境量
|
||||
* @param expire 过期时间
|
||||
* @param timeUnit 过期时间单位
|
||||
* @return Long
|
||||
*/
|
||||
Long incr(String key, long delta, Long expire, TimeUnit timeUnit);
|
||||
|
||||
/**
|
||||
* get 数字
|
||||
*
|
||||
* @param key key
|
||||
* @return Long
|
||||
*/
|
||||
Long getLong(String key);
|
||||
}
|
||||
Reference in New Issue
Block a user