mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-12-26 17:36:04 +08:00
v3.20.0 【新增】优化登录使用spring cache;【新增】优化部门cache;【新增】代码生成枚举;【优化】三级等保Label显示宽度
This commit is contained in:
@@ -2,6 +2,7 @@ package net.lab1024.sa.base.common.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -15,7 +16,7 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class UserPermission {
|
||||
public class UserPermission implements Serializable {
|
||||
|
||||
/**
|
||||
* 权限列表
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
package net.lab1024.sa.base.config;
|
||||
|
||||
import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
|
||||
import net.lab1024.sa.base.module.support.cache.CacheService;
|
||||
import net.lab1024.sa.base.module.support.cache.CaffeineCacheServiceImpl;
|
||||
import net.lab1024.sa.base.module.support.cache.RedisCacheServiceImpl;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.serializer.RedisSerializationContext;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 缓存配置
|
||||
@@ -20,6 +26,18 @@ public class CacheConfig {
|
||||
private static final String CAFFEINE_CACHE = "caffeine";
|
||||
|
||||
|
||||
@Resource
|
||||
private RedisConnectionFactory factory;
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE)
|
||||
public RedisCacheConfiguration redisCacheConfiguration() {
|
||||
return RedisCacheConfiguration.defaultCacheConfig()
|
||||
.disableCachingNullValues()
|
||||
.computePrefixWith(name -> "cache:" + name + ":")
|
||||
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericFastJsonRedisSerializer()));
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE)
|
||||
public CacheService redisCacheService() {
|
||||
|
||||
@@ -66,7 +66,7 @@ spring:
|
||||
|
||||
# 缓存实现类型
|
||||
cache:
|
||||
type: caffeine
|
||||
type: redis
|
||||
|
||||
# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误)
|
||||
server:
|
||||
@@ -88,8 +88,8 @@ file:
|
||||
region: oss-cn-hangzhou
|
||||
endpoint: oss-cn-hangzhou.aliyuncs.com
|
||||
bucket-name: 1024lab-smart-admin
|
||||
access-key:
|
||||
secret-key:
|
||||
access-key:
|
||||
secret-key:
|
||||
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||
private-url-expire-seconds: 3600
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ spring:
|
||||
|
||||
# 缓存实现类型
|
||||
cache:
|
||||
type: caffeine
|
||||
type: redis
|
||||
|
||||
# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误)
|
||||
server:
|
||||
|
||||
@@ -65,7 +65,7 @@ spring:
|
||||
|
||||
# 缓存实现类型
|
||||
cache:
|
||||
type: caffeine
|
||||
type: redis
|
||||
|
||||
# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误)
|
||||
server:
|
||||
|
||||
@@ -66,7 +66,7 @@ spring:
|
||||
|
||||
# 缓存实现类型
|
||||
cache:
|
||||
type: caffeine
|
||||
type: redis
|
||||
|
||||
# tomcat 配置,主要用于 配置 访问日志(便于将来排查错误)
|
||||
server:
|
||||
|
||||
Reference in New Issue
Block a user