Package cn.sinozg.applet.common.sa
Class SaTokenRedisJackson
java.lang.Object
cn.sinozg.applet.common.sa.SaTokenRedisJackson
- All Implemented Interfaces:
cn.dev33.satoken.dao.SaTokenDao
@Component
public class SaTokenRedisJackson
extends Object
implements cn.dev33.satoken.dao.SaTokenDao
Sa-Token 持久层实现 [Redis存储、Jackson序列化]
-
Field Summary
FieldsFields inherited from interface cn.dev33.satoken.dao.SaTokenDao
NEVER_EXPIRE, NOT_VALUE_EXPIRE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid删除ValuevoiddeleteObject(String key) 删除Object获取Value,如无返空获取Object,如无返空longgetObjectTimeout(String key) 获取Object的剩余存活时间 (单位: 秒)longgetTimeout(String key) 获取Value的剩余存活时间 (单位: 秒)voidinit()cn.dev33.satoken.fun.strategy.SaCreateSessionFunction无语 底层 SaTokenDao 煞笔一样的注入方式searchData(String prefix, String keyword, int start, int size, boolean sortType) 搜索数据void写入Value,并设定存活时间 (单位: 秒)void写入Object,并设定存活时间 (单位: 秒)private void写入Value,并设定存活时间 (单位: 秒)void修修改指定key-value键值对 (过期时间不变)voidupdateObject(String key, Object object) 更新Object (过期时间不变)voidupdateObjectTimeout(String key, long timeout) 修改Object的剩余存活时间 (单位: 秒)voidupdateTimeout(String key, long timeout) 修改Value的剩余存活时间 (单位: 秒)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cn.dev33.satoken.dao.SaTokenDao
deleteSession, destroy, getSession, getSessionTimeout, setSession, updateSession, updateSessionTimeout
-
Field Details
-
isInit
public boolean isInit -
log
private final org.slf4j.Logger log
-
-
Constructor Details
-
SaTokenRedisJackson
public SaTokenRedisJackson()
-
-
Method Details
-
initSession
@Bean public cn.dev33.satoken.fun.strategy.SaCreateSessionFunction initSession()无语 底层 SaTokenDao 煞笔一样的注入方式- Returns:
- 参数
-
init
public void init()- Specified by:
initin interfacecn.dev33.satoken.dao.SaTokenDao
-
get
获取Value,如无返空- Specified by:
getin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值- Returns:
- 结果
-
set
写入Value,并设定存活时间 (单位: 秒)- Specified by:
setin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值value- value值timeout- 过期时间
-
update
修修改指定key-value键值对 (过期时间不变)- Specified by:
updatein interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值value- value值
-
delete
删除Value- Specified by:
deletein interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值
-
getTimeout
获取Value的剩余存活时间 (单位: 秒)- Specified by:
getTimeoutin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值- Returns:
- 过期时间
-
updateTimeout
修改Value的剩余存活时间 (单位: 秒)- Specified by:
updateTimeoutin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值timeout- 过期时间
-
getObject
获取Object,如无返空- Specified by:
getObjectin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值- Returns:
- 结果
-
setObject
写入Object,并设定存活时间 (单位: 秒)- Specified by:
setObjectin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值object- 对象的值timeout- 过期时间
-
updateObject
更新Object (过期时间不变)- Specified by:
updateObjectin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值object- 对象的值
-
deleteObject
删除Object- Specified by:
deleteObjectin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值
-
getObjectTimeout
获取Object的剩余存活时间 (单位: 秒)- Specified by:
getObjectTimeoutin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值- Returns:
- 存活时间
-
updateObjectTimeout
修改Object的剩余存活时间 (单位: 秒)- Specified by:
updateObjectTimeoutin interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
key- key值timeout- 过期时间
-
searchData
public List<String> searchData(String prefix, String keyword, int start, int size, boolean sortType) 搜索数据- Specified by:
searchDatain interfacecn.dev33.satoken.dao.SaTokenDao- Parameters:
prefix- 前缀keyword- 关键词start- 开始size- 数量sortType- 排序类型- Returns:
- 搜索结果
-
setValue
写入Value,并设定存活时间 (单位: 秒)- Parameters:
key- key值value- value值timeout- 过期时间
-