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

[B端TOKEN缓存][修改][配置类]

release_toaliyun_real
gongbiao 6 лет назад
Родитель
Сommit
5c8cf2155f
8 измененных файлов: 139 добавлений и 36 удалений
  1. +18
    -5
      mallinkAdmin/src/main/java/com/iformall/config/RedisConfig.java
  2. +17
    -4
      mallinkCApi/src/main/java/com/iformall/config/RedisConfig.java
  3. +17
    -5
      mallinkCallback/src/main/java/com/iformall/config/RedisConfig.java
  4. +17
    -4
      mallinkMQConsumer/src/main/java/com/iformall/config/RedisConfig.java
  5. +17
    -4
      mallinkPosApi/src/main/java/com/iformall/config/RedisConfig.java
  6. +18
    -5
      mallinkSchedule/src/main/java/com/iformall/config/RedisConfig.java
  7. +18
    -5
      mallinkSysAdmin/src/main/java/com/iformall/config/RedisConfig.java
  8. +17
    -4
      mallinkWebSocketServer/src/main/java/com/iformall/config/RedisConfig.java

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

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

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxScoreRules;
import com.iformall.domain.po.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.CacheManager;
@@ -13,7 +10,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.cache.RedisCacheWriter;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
@@ -160,4 +156,21 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("buserTokenRedisTemplate")
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxBuser> template = new RedisTemplate();

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

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

template.setConnectionFactory(connectionFactory);
return template;
}

}

+ 17
- 4
mallinkCApi/src/main/java/com/iformall/config/RedisConfig.java Просмотреть файл

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

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxScoreRules;
import com.iformall.domain.po.*;
import com.iformall.domain.vo.WxCouponCVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -140,4 +137,20 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("buserTokenRedisTemplate")
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxBuser> template = new RedisTemplate();

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

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

template.setConnectionFactory(connectionFactory);
return template;
}
}

+ 17
- 5
mallinkCallback/src/main/java/com/iformall/config/RedisConfig.java Просмотреть файл

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

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxScoreRules;
import com.iformall.domain.po.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.CacheManager;
@@ -13,7 +10,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.cache.RedisCacheWriter;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
@@ -160,4 +156,20 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("buserTokenRedisTemplate")
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxBuser> template = new RedisTemplate();

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

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

template.setConnectionFactory(connectionFactory);
return template;
}
}

+ 17
- 4
mallinkMQConsumer/src/main/java/com/iformall/config/RedisConfig.java Просмотреть файл

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

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxScoreRules;
import com.iformall.domain.po.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.CacheManager;
@@ -144,4 +141,20 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("buserTokenRedisTemplate")
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxBuser> template = new RedisTemplate();

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

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

template.setConnectionFactory(connectionFactory);
return template;
}
}

+ 17
- 4
mallinkPosApi/src/main/java/com/iformall/config/RedisConfig.java Просмотреть файл

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

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxScoreRules;
import com.iformall.domain.po.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.CacheManager;
@@ -122,4 +119,20 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("buserTokenRedisTemplate")
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxBuser> template = new RedisTemplate();

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

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

template.setConnectionFactory(connectionFactory);
return template;
}
}

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

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

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxScoreRules;
import com.iformall.domain.po.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.CacheManager;
@@ -13,7 +10,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.cache.RedisCacheWriter;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
@@ -145,4 +141,21 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("buserTokenRedisTemplate")
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxBuser> template = new RedisTemplate();

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

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

template.setConnectionFactory(connectionFactory);
return template;
}

}

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

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

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxScoreRules;
import com.iformall.domain.po.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.CacheManager;
@@ -13,7 +10,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.cache.RedisCacheWriter;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
@@ -160,4 +156,21 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("buserTokenRedisTemplate")
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxBuser> template = new RedisTemplate();

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

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

template.setConnectionFactory(connectionFactory);
return template;
}

}

+ 17
- 4
mallinkWebSocketServer/src/main/java/com/iformall/config/RedisConfig.java Просмотреть файл

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

import com.iformall.domain.po.PushLimit;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxScoreRules;
import com.iformall.domain.po.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.CacheManager;
@@ -144,4 +141,20 @@ public class RedisConfig extends CachingConfigurerSupport {
return template;
}

@Bean("buserTokenRedisTemplate")
public RedisTemplate<String, WxBuser> getBuserTokenRedisTemplate(RedisConnectionFactory connectionFactory) {
RedisTemplate<String, WxBuser> template = new RedisTemplate();

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

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

template.setConnectionFactory(connectionFactory);
return template;
}
}

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