Просмотр исходного кода

[用户TOKEN缓存][修改]:redis添加

release_toaliyun_real
Stormeye Wu 7 лет назад
Родитель
Сommit
87cfcedd1d
4 измененных файлов: 72 добавлений и 0 удалений
  1. +18
    -0
      mallinkAdmin/src/main/java/com/iformall/config/RedisConfig.java
  2. +18
    -0
      mallinkBApi/src/main/java/com/iformall/config/RedisConfig.java
  3. +18
    -0
      mallinkSchedule/src/main/java/com/iformall/config/RedisConfig.java
  4. +18
    -0
      mallinkWechatOpen/src/main/java/com/iformall/config/RedisConfig.java

+ 18
- 0
mallinkAdmin/src/main/java/com/iformall/config/RedisConfig.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.iformall.config;

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxScoreRules;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -124,4 +125,21 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("cuserTokenRedisTemplate")
public RedisTemplate<String, WxCUser> getCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxCUser> template = new RedisTemplate<String, WxCUser>();

Jackson2JsonRedisSerializer<WxScoreRules> j = new Jackson2JsonRedisSerializer<WxScoreRules>(WxScoreRules.class);
// value值的序列化
template.setValueSerializer(j);
template.setHashKeySerializer(j);

// key的序列化
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(new StringRedisSerializer());

template.setConnectionFactory(connectionFactory);
return template;
}

}

+ 18
- 0
mallinkBApi/src/main/java/com/iformall/config/RedisConfig.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.iformall.config;

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxScoreRules;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -86,4 +87,21 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("cuserTokenRedisTemplate")
public RedisTemplate<String, WxCUser> getCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxCUser> template = new RedisTemplate<String, WxCUser>();

Jackson2JsonRedisSerializer<WxScoreRules> j = new Jackson2JsonRedisSerializer<WxScoreRules>(WxScoreRules.class);
// value值的序列化
template.setValueSerializer(j);
template.setHashKeySerializer(j);

// key的序列化
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(new StringRedisSerializer());

template.setConnectionFactory(connectionFactory);
return template;
}

}

+ 18
- 0
mallinkSchedule/src/main/java/com/iformall/config/RedisConfig.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.iformall.config;

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxScoreRules;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -109,4 +110,21 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("cuserTokenRedisTemplate")
public RedisTemplate<String, WxCUser> getCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxCUser> template = new RedisTemplate<String, WxCUser>();

Jackson2JsonRedisSerializer<WxScoreRules> j = new Jackson2JsonRedisSerializer<WxScoreRules>(WxScoreRules.class);
// value值的序列化
template.setValueSerializer(j);
template.setHashKeySerializer(j);

// key的序列化
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(new StringRedisSerializer());

template.setConnectionFactory(connectionFactory);
return template;
}

}

+ 18
- 0
mallinkWechatOpen/src/main/java/com/iformall/config/RedisConfig.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.iformall.config;

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxScoreRules;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -108,4 +109,21 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("cuserTokenRedisTemplate")
public RedisTemplate<String, WxCUser> getCUserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxCUser> template = new RedisTemplate<String, WxCUser>();

Jackson2JsonRedisSerializer<WxScoreRules> j = new Jackson2JsonRedisSerializer<WxScoreRules>(WxScoreRules.class);
// value值的序列化
template.setValueSerializer(j);
template.setHashKeySerializer(j);

// key的序列化
template.setKeySerializer(new StringRedisSerializer());
template.setHashKeySerializer(new StringRedisSerializer());

template.setConnectionFactory(connectionFactory);
return template;
}

}

Загрузка…
Отмена
Сохранить