修改插件名称:sa-token-dao-redis-string -> sa-token-dao-redis-fastjson

This commit is contained in:
click33 2022-08-21 15:38:06 +08:00
parent f0b49b451a
commit 3addd684d6
7 changed files with 28 additions and 20 deletions

View File

@ -21,8 +21,8 @@
<module>sa-token-alone-redis</module>
<module>sa-token-dao-redis</module>
<module>sa-token-dao-redis-jackson</module>
<module>sa-token-dao-redis-fastjson</module>
<module>sa-token-dao-redisx</module>
<module>sa-token-dao-redis-string</module>
<module>sa-token-dialect-thymeleaf</module>
<module>sa-token-sso</module>
<module>sa-token-oauth2</module>

View File

@ -10,7 +10,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>sa-token-dao-redix-string</artifactId>
<artifactId>sa-token-dao-redis-fastjson</artifactId>
<dependencies>
<!-- sa-token-spring-boot-starter -->

View File

@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit;
*
*/
@Component
public class SaTokenDaoRedisString implements SaTokenDao {
public class SaTokenDaoRedisFastjson implements SaTokenDao {
/**
* String专用
@ -29,7 +29,7 @@ public class SaTokenDaoRedisString implements SaTokenDao {
public StringRedisTemplate stringRedisTemplate;
/**
* Objecy专用
* Object专用
*/
public StringRedisTemplate objectRedisTemplate;
@ -40,6 +40,11 @@ public class SaTokenDaoRedisString implements SaTokenDao {
@Autowired
public void init(RedisConnectionFactory connectionFactory) {
// 不重复初始化
if(this.isInit) {
return;
}
// 指定相应的序列化方案
StringRedisSerializer keySerializer = new StringRedisSerializer();
StringRedisSerializer valueSerializer = new StringRedisSerializer();
@ -57,11 +62,9 @@ public class SaTokenDaoRedisString implements SaTokenDao {
template.afterPropertiesSet();
// 开始初始化相关组件
if(!this.isInit) {
this.stringRedisTemplate = stringTemplate;
this.objectRedisTemplate = template;
this.isInit = true;
}
this.stringRedisTemplate = stringTemplate;
this.objectRedisTemplate = template;
this.isInit = true;
}

View File

@ -1 +1 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.dev33.satoken.dao.SaTokenDaoRedisString
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.dev33.satoken.dao.SaTokenDaoRedisFastjson

View File

@ -69,6 +69,10 @@ public class SaTokenDaoRedisJackson implements SaTokenDao {
@Autowired
public void init(RedisConnectionFactory connectionFactory) {
// 不重复初始化
if(this.isInit) {
return;
}
// 指定相应的序列化方案
StringRedisSerializer keySerializer = new StringRedisSerializer();
@ -112,11 +116,9 @@ public class SaTokenDaoRedisJackson implements SaTokenDao {
template.afterPropertiesSet();
// 开始初始化相关组件
if(this.isInit == false) {
this.stringRedisTemplate = stringTemplate;
this.objectRedisTemplate = template;
this.isInit = true;
}
this.stringRedisTemplate = stringTemplate;
this.objectRedisTemplate = template;
this.isInit = true;
}

View File

@ -41,6 +41,11 @@ public class SaTokenDaoRedis implements SaTokenDao {
@Autowired
public void init(RedisConnectionFactory connectionFactory) {
// 不重复初始化
if(this.isInit) {
return;
}
// 指定相应的序列化方案
StringRedisSerializer keySerializer = new StringRedisSerializer();
JdkSerializationRedisSerializer valueSerializer = new JdkSerializationRedisSerializer();
@ -58,11 +63,9 @@ public class SaTokenDaoRedis implements SaTokenDao {
template.afterPropertiesSet();
// 开始初始化相关组件
if(this.isInit == false) {
this.stringRedisTemplate = stringTemplate;
this.objectRedisTemplate = template;
this.isInit = true;
}
this.stringRedisTemplate = stringTemplate;
this.objectRedisTemplate = template;
this.isInit = true;
}