From 4b34c9960c5bcf1baee0a99cd3bb93edf6a3bcd3 Mon Sep 17 00:00:00 2001 From: zhuoda Date: Mon, 18 Aug 2025 21:11:44 +0800 Subject: [PATCH] v3.27 --- README.md | 4 +- .../system/login/manager/LoginManager.java | 15 +- .../system/login/service/LoginService.java | 7 +- .../lab1024/sa/base/config/CacheConfig.java | 50 ++++-- .../support/cache/RedisCacheServiceImpl.java | 3 +- .../manager/CustomRedisCacheManager.java | 144 +++++++++++++++++ .../support/dict/domain/vo/DictDataVO.java | 2 +- .../module/support/dict/domain/vo/DictVO.java | 2 +- .../redis/CustomRedisCacheManager.java | 145 ++++++++++++++++++ .../system/login/manager/LoginManager.java | 15 +- .../system/login/service/LoginService.java | 7 +- .../lab1024/sa/base/config/CacheConfig.java | 50 ++++-- .../support/dict/domain/vo/DictDataVO.java | 2 +- .../module/support/dict/domain/vo/DictVO.java | 2 +- .../redis/CustomRedisCacheManager.java | 145 ++++++++++++++++++ .../code-generator/code-generator-util.js | 17 ++ .../src/views/system/home/index.vue | 8 +- .../code-generator/code-generator-util.ts | 17 ++ {sql => 数据库SQL脚本}/README.md | 0 .../mysql}/smart_admin_v3.sql | 2 +- .../mysql}/sql-update-log/v3.15.0.sql | 0 .../mysql}/sql-update-log/v3.18.0.sql | 0 .../mysql}/sql-update-log/v3.21.0.sql | 0 .../mysql}/sql-update-log/v3.23.0.sql | 0 .../mysql}/sql-update-log/v3.25.0.sql | 0 .../mysql}/sql-update-log/v3.26.0.sql | 0 数据库SQL脚本/postgresql/README.md | 9 ++ 数据库SQL脚本/国产数据库/OceanBase/README.md | 11 ++ 数据库SQL脚本/国产数据库/人大金仓/README.md | 11 ++ 数据库SQL脚本/国产数据库/南大通用/README.md | 11 ++ 数据库SQL脚本/国产数据库/腾讯TDSQL/README.md | 11 ++ 数据库SQL脚本/国产数据库/达梦/README.md | 11 ++ .../国产数据库/阿里PolarDB/README.md | 11 ++ .../国产数据库/高斯GaussDB/README.md | 11 ++ 34 files changed, 669 insertions(+), 54 deletions(-) create mode 100644 smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/cache/manager/CustomRedisCacheManager.java create mode 100644 smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/redis/CustomRedisCacheManager.java create mode 100644 smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/redis/CustomRedisCacheManager.java rename {sql => 数据库SQL脚本}/README.md (100%) rename {sql => 数据库SQL脚本/mysql}/smart_admin_v3.sql (99%) rename {sql => 数据库SQL脚本/mysql}/sql-update-log/v3.15.0.sql (100%) rename {sql => 数据库SQL脚本/mysql}/sql-update-log/v3.18.0.sql (100%) rename {sql => 数据库SQL脚本/mysql}/sql-update-log/v3.21.0.sql (100%) rename {sql => 数据库SQL脚本/mysql}/sql-update-log/v3.23.0.sql (100%) rename {sql => 数据库SQL脚本/mysql}/sql-update-log/v3.25.0.sql (100%) rename {sql => 数据库SQL脚本/mysql}/sql-update-log/v3.26.0.sql (100%) create mode 100644 数据库SQL脚本/postgresql/README.md create mode 100644 数据库SQL脚本/国产数据库/OceanBase/README.md create mode 100644 数据库SQL脚本/国产数据库/人大金仓/README.md create mode 100644 数据库SQL脚本/国产数据库/南大通用/README.md create mode 100644 数据库SQL脚本/国产数据库/腾讯TDSQL/README.md create mode 100644 数据库SQL脚本/国产数据库/达梦/README.md create mode 100644 数据库SQL脚本/国产数据库/阿里PolarDB/README.md create mode 100644 数据库SQL脚本/国产数据库/高斯GaussDB/README.md diff --git a/README.md b/README.md index 0b5c3ad..ed2a361 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ **国内首个满足《网络安全-三级等保》、《数据安全》** 功能要求,支持登录限制、接口国产加解密、数据脱敏等一系列安全要求。 -**支持国产数据库:达梦、金仓、南大通用、OceanBase、GaussDB 高斯、阿里PolarDB、GoldenDB。 ** +**支持国产数据库:【达梦、金仓、南大通用、OceanBase、GaussDB 高斯、阿里PolarDB、GoldenDB】等,主流数据库:【Mysql, PostgreSQL】等** -前端提供 **JavaScript和TypeScript双版本**,后端提供 **Java8+SpringBoot2.X和Java17+SpringBoot3.X 双版本**。 + **前端提供JavaScript和TypeScript双版本,后端提供Java8+SpringBoot2.X和Java17+SpringBoot3.X 双版本**。 同时 **重磅开源** 开源六年来 **千余家企业验证过且正在使用** 的代码规范: **《高质量代码思想》、《Vue3规范》、《Java规范》** ,让大家在这浮躁的世界里感受到一股把代码写好的清流!同时又能节省大量时间,减少加班,快乐工作,保持谦逊,保持学习,**热爱代码,更热爱生活** ! ### **技术体系** diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java index 434e4ec..6383028 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java @@ -153,8 +153,19 @@ public class LoginManager { } - @CacheEvict(value = {AdminCacheConst.Login.USER_PERMISSION, AdminCacheConst.Login.REQUEST_EMPLOYEE}, allEntries = true) - public void clear(){ + /** + * 清除用户权限 + */ + @CacheEvict(value = AdminCacheConst.Login.USER_PERMISSION) + public void clearUserPermission(Long employeeId) { + + } + + /** + * 清除用户登录信息 + */ + @CacheEvict(value = AdminCacheConst.Login.REQUEST_EMPLOYEE) + public void clearUserLoginInfo(Long employeeId) { } diff --git a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java index 7b18f25..2e3b7c8 100644 --- a/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java +++ b/smart-admin-api-java17-springboot3/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java @@ -317,8 +317,8 @@ public class LoginService implements StpInterface { // sa token 登出 StpUtil.logout(); - // 清空登录信息缓存 - loginManager.clear(); + // 清除用户登录信息缓存和权限信息 + this.clearLoginEmployeeCache(requestUser.getUserId()); //保存登出日志 LoginLogEntity loginEntity = LoginLogEntity.builder() @@ -474,6 +474,7 @@ public class LoginService implements StpInterface { } public void clearLoginEmployeeCache(Long employeeId) { - loginManager.clear(); + loginManager.clearUserPermission(employeeId); + loginManager.clearUserLoginInfo(employeeId); } } diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java index 902d5cf..bccb2de 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java @@ -5,18 +5,19 @@ import jakarta.annotation.Resource; 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 net.lab1024.sa.base.module.support.redis.CustomRedisCacheManager; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.cache.CacheManager; 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.RedisCacheWriter; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.serializer.RedisSerializationContext; /** * 缓存配置 * - * @author zhoumingfa - * @date 2025/03/28 */ @Configuration public class CacheConfig { @@ -26,27 +27,44 @@ public class CacheConfig { @Resource - private RedisConnectionFactory factory; + private RedisConnectionFactory redisConnectionFactory; + /** + * 创建自定义Redis缓存管理器Bean 整合spring-cache + * Redis连接工厂,用于建立与Redis服务器的连接 + * + * @return CacheManager Redis缓存管理器实例 + */ @Bean @ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE) - public RedisCacheConfiguration redisCacheConfiguration() { - return RedisCacheConfiguration.defaultCacheConfig() + public CacheManager cacheManager() { + // 使用非阻塞模式的缓存写入器,适用于大多数高并发场景 + RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory); + + // 构建默认缓存配置 + RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig() + // 禁止缓存 null 值,避免缓存穿透 .disableCachingNullValues() .computePrefixWith(name -> "cache:" + name + ":") - .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericFastJsonRedisSerializer())); + // 使用 FastJSON 序列化缓存值,支持复杂对象 + .serializeValuesWith(RedisSerializationContext.SerializationPair + .fromSerializer(new GenericFastJsonRedisSerializer())); + + // 返回自定义缓存管理器,支持 cacheName#ttl 格式与永久缓存(#-1) + return new CustomRedisCacheManager(redisCacheWriter, defaultCacheConfig); } - @Bean - @ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE) - public CacheService redisCacheService() { - return new RedisCacheServiceImpl(); - } - @Bean - @ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = CAFFEINE_CACHE) - public CacheService caffeineCacheService() { - return new CaffeineCacheServiceImpl(); - } +@Bean +@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE) +public CacheService redisCacheService() { + return new RedisCacheServiceImpl(); +} + +@Bean +@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = CAFFEINE_CACHE) +public CacheService caffeineCacheService() { + return new CaffeineCacheServiceImpl(); +} } \ No newline at end of file diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/cache/RedisCacheServiceImpl.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/cache/RedisCacheServiceImpl.java index 5e04fcc..eda2a32 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/cache/RedisCacheServiceImpl.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/cache/RedisCacheServiceImpl.java @@ -10,6 +10,7 @@ import org.springframework.data.redis.cache.RedisCacheManager; import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.connection.RedisConnectionFactory; +import java.nio.charset.StandardCharsets; import java.util.Collection; import java.util.List; import java.util.Set; @@ -53,7 +54,7 @@ public class RedisCacheServiceImpl implements CacheService { if (keys != null) { return keys.stream().map(key -> { - String redisKey = StrUtil.str(key, "utf-8"); + String redisKey = StrUtil.str(key, StandardCharsets.UTF_8); // 从 Redis 键中提取出最后一个冒号后面的字符串作为真正的键 return redisKey.substring(redisKey.lastIndexOf(":") + 1); }).collect(Collectors.toList()); diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/cache/manager/CustomRedisCacheManager.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/cache/manager/CustomRedisCacheManager.java new file mode 100644 index 0000000..ce95926 --- /dev/null +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/cache/manager/CustomRedisCacheManager.java @@ -0,0 +1,144 @@ +package net.lab1024.sa.base.module.support.cache.manager; + +import cn.hutool.core.util.StrUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.convert.DurationStyle; +import org.springframework.data.redis.cache.*; + +import java.time.Duration; + +import static net.lab1024.sa.base.common.constant.StringConst.COLON; + +/** + * 自定义 RedisCacheManager,支持在 cacheName 中通过 '#' 指定 TTL(过期时间)。 + * @Author CoderKK + * @Date 2025-08-15 13:01:01 + *

+ * 支持格式:{@code cacheName#ttl},其中 ttl 支持 Spring 的 Duration 格式。 + * 特殊值:{@code -1} 表示永久缓存(永不过期)。 + *

+ * + *

使用示例:

+ *
+ * // 10 秒后过期
+ * @Cacheable(value = "user#10s", key = "#id")
+ * // 2 小时后过期
+ * @Cacheable(value = "report#2h", key = "#date")
+ * // 30 分钟后过期
+ * @Cacheable(value = "session#30m", key = "#token")
+ * // 永不过期(永久缓存),适用于极少变化的配置数据
+ * @Cacheable(value = "appConfig#-1", key = "'globalSettings'")
+ * // 无 TTL,使用全局默认过期时间(如 7 天)
+ * @Cacheable(value = "product", key = "#productId")
+ * 
+ * + *

生成的 Redis Key 格式:

+ *
+ * cache:cacheName:key
+ * 例如:cache:user:123
+ *      cache:appConfig:globalSettings
+ * 
+ * + *

支持的 TTL 单位:

+ * + * + *

注意事项:

+ * + */ +@Slf4j +public class CustomRedisCacheManager extends RedisCacheManager { + + /** + * 缓存全局前缀 + */ + private static final String CACHE_PREFIX = "cache"; + + /** + * 自定义 TTL 分隔符,用于在 cacheName 后附加过期时间 + */ + private static final String CUSTOM_TTL_SEPARATOR = "#"; + + /** + * 默认缓存过期时间:7 天 + */ + private static final Duration DEFAULT_TTL = Duration.ofDays(7); + + public CustomRedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration) { + super(cacheWriter, defaultCacheConfiguration); + } + + /** + * 创建 RedisCache 实例,支持从 cacheName 解析 TTL + * + * @param name 缓存名称(支持 name#ttl 格式) + * @param cacheConfig 默认缓存配置 + * @return RedisCache + */ + @Override + protected RedisCache createRedisCache(String name, RedisCacheConfiguration cacheConfig) { + Duration ttl = parseTtlFromCacheName(name); + if (ttl == null) { + ttl = DEFAULT_TTL; + } + + CacheKeyPrefix keyPrefix = cacheName -> { + if (StrUtil.isBlank(cacheName)) { + return CACHE_PREFIX + COLON; + } + String[] parts = cacheName.split(CUSTOM_TTL_SEPARATOR, 2); + String cleanName = StrUtil.trim(parts[0]); + return CACHE_PREFIX + COLON + cleanName + COLON; + }; + + // 构建最终缓存配置:设置 key 前缀 + TTL + RedisCacheConfiguration config = cacheConfig.computePrefixWith(keyPrefix).entryTtl(ttl); + + return super.createRedisCache(name, config); + } + + /** + * 从 cacheName 中解析 TTL + * + * @param name 缓存名称,格式如:users#10m, products#2h, config#-1(永久) + * @return 解析出的 Duration若无效则返回 null;若为 -1,则返回 Duration.ofMillis(-1) 表示永久缓存 + */ + private Duration parseTtlFromCacheName(String name) { + if (StrUtil.isBlank(name)) { + return null; + } + + String[] parts = name.split(CUSTOM_TTL_SEPARATOR, 2); + if (parts.length < 2) { + return null; // 无 TTL 部分 + } + + String ttlStr = StrUtil.trim(parts[1]); + if (StrUtil.isBlank(ttlStr)) { + return null; + } + + // 特殊处理:-1 表示永久缓存 + if ("-1".equals(ttlStr)) { + return Duration.ofMillis(-1); // Spring Redis 中负数 Duration 表示永不过期 + } + + try { + Duration ttl = DurationStyle.detectAndParse(ttlStr); + return ttl.toSeconds() > 0 ? ttl : null; + } catch (IllegalArgumentException e) { + log.debug("解析缓存 TTL 失败,cacheName='{}', ttl='{}', 错误: {}", name, ttlStr, e.getMessage()); + return null; + } + } +} \ No newline at end of file diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictDataVO.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictDataVO.java index 1fdd6fb..761799a 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictDataVO.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictDataVO.java @@ -30,7 +30,7 @@ public class DictDataVO implements Serializable { private String dictName; @Schema(description = "字典禁用状态") - private Integer dictDisabledFlag; + private Boolean dictDisabledFlag; @Schema(description = "字典项值") private String dataValue; diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictVO.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictVO.java index 1625ce4..4a9131c 100644 --- a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictVO.java +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictVO.java @@ -30,7 +30,7 @@ public class DictVO { private String remark; @Schema(description = "禁用状态") - private Integer disabledFlag; + private Boolean disabledFlag; @Schema(description = "创建时间") private LocalDateTime createTime; diff --git a/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/redis/CustomRedisCacheManager.java b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/redis/CustomRedisCacheManager.java new file mode 100644 index 0000000..4ff66aa --- /dev/null +++ b/smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/redis/CustomRedisCacheManager.java @@ -0,0 +1,145 @@ +package net.lab1024.sa.base.module.support.redis; + +import cn.hutool.core.util.StrUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.convert.DurationStyle; +import org.springframework.data.redis.cache.*; + +import java.time.Duration; + +import static net.lab1024.sa.base.common.constant.StringConst.COLON; + +/** + * 自定义 RedisCacheManager,支持在 cacheName 中通过 '#' 指定 TTL(过期时间)。 + * + * @Author CoderKK + * @Date 2025-08-15 13:01:01 + *

+ * 支持格式:{@code cacheName#ttl},其中 ttl 支持 Spring 的 Duration 格式。 + * 特殊值:{@code -1} 表示永久缓存(永不过期)。 + *

+ * + *

使用示例:

+ *
+ * // 10 秒后过期
+ * @Cacheable(value = "user#10s", key = "#id")
+ * // 2 小时后过期
+ * @Cacheable(value = "report#2h", key = "#date")
+ * // 30 分钟后过期
+ * @Cacheable(value = "session#30m", key = "#token")
+ * // 永不过期(永久缓存),适用于极少变化的配置数据
+ * @Cacheable(value = "appConfig#-1", key = "'globalSettings'")
+ * // 无 TTL,使用全局默认过期时间(如 7 天)
+ * @Cacheable(value = "product", key = "#productId")
+ * 
+ * + *

生成的 Redis Key 格式:

+ *
+ * cache:cacheName:key
+ * 例如:cache:user:123
+ *      cache:appConfig:globalSettings
+ * 
+ * + *

支持的 TTL 单位:

+ * + * + *

注意事项:

+ * + */ +@Slf4j +public class CustomRedisCacheManager extends RedisCacheManager { + + /** + * 缓存全局前缀 + */ + private static final String CACHE_PREFIX = "cache"; + + /** + * 自定义 TTL 分隔符,用于在 cacheName 后附加过期时间 + */ + private static final String CUSTOM_TTL_SEPARATOR = "#"; + + /** + * 默认缓存过期时间:7 天 + */ + private static final Duration DEFAULT_TTL = Duration.ofDays(7); + + public CustomRedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration) { + super(cacheWriter, defaultCacheConfiguration); + } + + /** + * 创建 RedisCache 实例,支持从 cacheName 解析 TTL + * + * @param name 缓存名称(支持 name#ttl 格式) + * @param cacheConfig 默认缓存配置 + * @return RedisCache + */ + @Override + protected RedisCache createRedisCache(String name, RedisCacheConfiguration cacheConfig) { + Duration ttl = parseTtlFromCacheName(name); + if (ttl == null) { + ttl = DEFAULT_TTL; + } + + CacheKeyPrefix keyPrefix = cacheName -> { + if (StrUtil.isBlank(cacheName)) { + return CACHE_PREFIX + COLON; + } + String[] parts = cacheName.split(CUSTOM_TTL_SEPARATOR, 2); + String cleanName = StrUtil.trim(parts[0]); + return CACHE_PREFIX + COLON + cleanName + COLON; + }; + + // 构建最终缓存配置:设置 key 前缀 + TTL + RedisCacheConfiguration config = cacheConfig.computePrefixWith(keyPrefix).entryTtl(ttl); + + return super.createRedisCache(name, config); + } + + /** + * 从 cacheName 中解析 TTL + * + * @param name 缓存名称,格式如:users#10m, products#2h, config#-1(永久) + * @return 解析出的 Duration若无效则返回 null;若为 -1,则返回 Duration.ofMillis(-1) 表示永久缓存 + */ + private Duration parseTtlFromCacheName(String name) { + if (StrUtil.isBlank(name)) { + return null; + } + + String[] parts = name.split(CUSTOM_TTL_SEPARATOR, 2); + if (parts.length < 2) { + return null; // 无 TTL 部分 + } + + String ttlStr = StrUtil.trim(parts[1]); + if (StrUtil.isBlank(ttlStr)) { + return null; + } + + // 特殊处理:-1 表示永久缓存 + if ("-1".equals(ttlStr)) { + return Duration.ofMillis(-1); // Spring Redis 中负数 Duration 表示永不过期 + } + + try { + Duration ttl = DurationStyle.detectAndParse(ttlStr); + return ttl.getSeconds() > 0 ? ttl : null; + } catch (IllegalArgumentException e) { + log.error("解析缓存 TTL 失败,cacheName='{}', ttl='{}', 错误: {}", name, ttlStr, e); + return null; + } + } +} diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java index 7dd4127..8b5ac13 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/manager/LoginManager.java @@ -153,8 +153,19 @@ public class LoginManager { } - @CacheEvict(value = {AdminCacheConst.Login.USER_PERMISSION, AdminCacheConst.Login.REQUEST_EMPLOYEE}, allEntries = true) - public void clear(){ + /** + * 清除用户权限 + */ + @CacheEvict(value = AdminCacheConst.Login.USER_PERMISSION) + public void clearUserPermission(Long employeeId) { + + } + + /** + * 清除用户登录信息 + */ + @CacheEvict(value = AdminCacheConst.Login.REQUEST_EMPLOYEE) + public void clearUserLoginInfo(Long employeeId) { } diff --git a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java index 29d4778..3912405 100644 --- a/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java +++ b/smart-admin-api-java8-springboot2/sa-admin/src/main/java/net/lab1024/sa/admin/module/system/login/service/LoginService.java @@ -319,8 +319,8 @@ public class LoginService implements StpInterface { // sa token 登出 StpUtil.logout(); - // 清空登录信息缓存 - loginManager.clear(); + // 清除用户登录信息缓存和权限信息 + this.clearLoginEmployeeCache(requestUser.getUserId()); //保存登出日志 LoginLogEntity loginEntity = LoginLogEntity.builder() @@ -476,6 +476,7 @@ public class LoginService implements StpInterface { } public void clearLoginEmployeeCache(Long employeeId) { - loginManager.clear(); + loginManager.clearUserPermission(employeeId); + loginManager.clearUserLoginInfo(employeeId); } } diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java index 5beb741..665a23f 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/CacheConfig.java @@ -4,10 +4,13 @@ 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 net.lab1024.sa.base.module.support.redis.CustomRedisCacheManager; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.cache.CacheManager; 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.RedisCacheWriter; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.serializer.RedisSerializationContext; @@ -16,8 +19,6 @@ import javax.annotation.Resource; /** * 缓存配置 * - * @author zhoumingfa - * @date 2025/03/28 */ @Configuration public class CacheConfig { @@ -27,27 +28,44 @@ public class CacheConfig { @Resource - private RedisConnectionFactory factory; + private RedisConnectionFactory redisConnectionFactory; + /** + * 创建自定义Redis缓存管理器Bean 整合spring-cache + * Redis连接工厂,用于建立与Redis服务器的连接 + * + * @return CacheManager Redis缓存管理器实例 + */ @Bean @ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE) - public RedisCacheConfiguration redisCacheConfiguration() { - return RedisCacheConfiguration.defaultCacheConfig() + public CacheManager cacheManager() { + // 使用非阻塞模式的缓存写入器,适用于大多数高并发场景 + RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory); + + // 构建默认缓存配置 + RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig() + // 禁止缓存 null 值,避免缓存穿透 .disableCachingNullValues() .computePrefixWith(name -> "cache:" + name + ":") - .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericFastJsonRedisSerializer())); + // 使用 FastJSON 序列化缓存值,支持复杂对象 + .serializeValuesWith(RedisSerializationContext.SerializationPair + .fromSerializer(new GenericFastJsonRedisSerializer())); + + // 返回自定义缓存管理器,支持 cacheName#ttl 格式与永久缓存(#-1) + return new CustomRedisCacheManager(redisCacheWriter, defaultCacheConfig); } - @Bean - @ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE) - public CacheService redisCacheService() { - return new RedisCacheServiceImpl(); - } - @Bean - @ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = CAFFEINE_CACHE) - public CacheService caffeineCacheService() { - return new CaffeineCacheServiceImpl(); - } +@Bean +@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE) +public CacheService redisCacheService() { + return new RedisCacheServiceImpl(); +} + +@Bean +@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = CAFFEINE_CACHE) +public CacheService caffeineCacheService() { + return new CaffeineCacheServiceImpl(); +} } \ No newline at end of file diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictDataVO.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictDataVO.java index 1fdd6fb..761799a 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictDataVO.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictDataVO.java @@ -30,7 +30,7 @@ public class DictDataVO implements Serializable { private String dictName; @Schema(description = "字典禁用状态") - private Integer dictDisabledFlag; + private Boolean dictDisabledFlag; @Schema(description = "字典项值") private String dataValue; diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictVO.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictVO.java index 1625ce4..4a9131c 100644 --- a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictVO.java +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/domain/vo/DictVO.java @@ -30,7 +30,7 @@ public class DictVO { private String remark; @Schema(description = "禁用状态") - private Integer disabledFlag; + private Boolean disabledFlag; @Schema(description = "创建时间") private LocalDateTime createTime; diff --git a/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/redis/CustomRedisCacheManager.java b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/redis/CustomRedisCacheManager.java new file mode 100644 index 0000000..4ff66aa --- /dev/null +++ b/smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/redis/CustomRedisCacheManager.java @@ -0,0 +1,145 @@ +package net.lab1024.sa.base.module.support.redis; + +import cn.hutool.core.util.StrUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.convert.DurationStyle; +import org.springframework.data.redis.cache.*; + +import java.time.Duration; + +import static net.lab1024.sa.base.common.constant.StringConst.COLON; + +/** + * 自定义 RedisCacheManager,支持在 cacheName 中通过 '#' 指定 TTL(过期时间)。 + * + * @Author CoderKK + * @Date 2025-08-15 13:01:01 + *

+ * 支持格式:{@code cacheName#ttl},其中 ttl 支持 Spring 的 Duration 格式。 + * 特殊值:{@code -1} 表示永久缓存(永不过期)。 + *

+ * + *

使用示例:

+ *
+ * // 10 秒后过期
+ * @Cacheable(value = "user#10s", key = "#id")
+ * // 2 小时后过期
+ * @Cacheable(value = "report#2h", key = "#date")
+ * // 30 分钟后过期
+ * @Cacheable(value = "session#30m", key = "#token")
+ * // 永不过期(永久缓存),适用于极少变化的配置数据
+ * @Cacheable(value = "appConfig#-1", key = "'globalSettings'")
+ * // 无 TTL,使用全局默认过期时间(如 7 天)
+ * @Cacheable(value = "product", key = "#productId")
+ * 
+ * + *

生成的 Redis Key 格式:

+ *
+ * cache:cacheName:key
+ * 例如:cache:user:123
+ *      cache:appConfig:globalSettings
+ * 
+ * + *

支持的 TTL 单位:

+ * + * + *

注意事项:

+ * + */ +@Slf4j +public class CustomRedisCacheManager extends RedisCacheManager { + + /** + * 缓存全局前缀 + */ + private static final String CACHE_PREFIX = "cache"; + + /** + * 自定义 TTL 分隔符,用于在 cacheName 后附加过期时间 + */ + private static final String CUSTOM_TTL_SEPARATOR = "#"; + + /** + * 默认缓存过期时间:7 天 + */ + private static final Duration DEFAULT_TTL = Duration.ofDays(7); + + public CustomRedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration) { + super(cacheWriter, defaultCacheConfiguration); + } + + /** + * 创建 RedisCache 实例,支持从 cacheName 解析 TTL + * + * @param name 缓存名称(支持 name#ttl 格式) + * @param cacheConfig 默认缓存配置 + * @return RedisCache + */ + @Override + protected RedisCache createRedisCache(String name, RedisCacheConfiguration cacheConfig) { + Duration ttl = parseTtlFromCacheName(name); + if (ttl == null) { + ttl = DEFAULT_TTL; + } + + CacheKeyPrefix keyPrefix = cacheName -> { + if (StrUtil.isBlank(cacheName)) { + return CACHE_PREFIX + COLON; + } + String[] parts = cacheName.split(CUSTOM_TTL_SEPARATOR, 2); + String cleanName = StrUtil.trim(parts[0]); + return CACHE_PREFIX + COLON + cleanName + COLON; + }; + + // 构建最终缓存配置:设置 key 前缀 + TTL + RedisCacheConfiguration config = cacheConfig.computePrefixWith(keyPrefix).entryTtl(ttl); + + return super.createRedisCache(name, config); + } + + /** + * 从 cacheName 中解析 TTL + * + * @param name 缓存名称,格式如:users#10m, products#2h, config#-1(永久) + * @return 解析出的 Duration若无效则返回 null;若为 -1,则返回 Duration.ofMillis(-1) 表示永久缓存 + */ + private Duration parseTtlFromCacheName(String name) { + if (StrUtil.isBlank(name)) { + return null; + } + + String[] parts = name.split(CUSTOM_TTL_SEPARATOR, 2); + if (parts.length < 2) { + return null; // 无 TTL 部分 + } + + String ttlStr = StrUtil.trim(parts[1]); + if (StrUtil.isBlank(ttlStr)) { + return null; + } + + // 特殊处理:-1 表示永久缓存 + if ("-1".equals(ttlStr)) { + return Duration.ofMillis(-1); // Spring Redis 中负数 Duration 表示永不过期 + } + + try { + Duration ttl = DurationStyle.detectAndParse(ttlStr); + return ttl.getSeconds() > 0 ? ttl : null; + } catch (IllegalArgumentException e) { + log.error("解析缓存 TTL 失败,cacheName='{}', ttl='{}', 错误: {}", name, ttlStr, e); + return null; + } + } +} diff --git a/smart-admin-web-javascript/src/views/support/code-generator/code-generator-util.js b/smart-admin-web-javascript/src/views/support/code-generator/code-generator-util.js index a942902..7961bbe 100644 --- a/smart-admin-web-javascript/src/views/support/code-generator/code-generator-util.js +++ b/smart-admin-web-javascript/src/views/support/code-generator/code-generator-util.js @@ -3,12 +3,16 @@ import { convertUpperCamel } from '/@/utils/str-util'; // -------------------------------- java 类型 -------------------------------- export const JavaTypeMap = new Map(); JavaTypeMap.set('bit', 'Boolean'); +JavaTypeMap.set('bool', 'Boolean'); JavaTypeMap.set('int', 'Integer'); +JavaTypeMap.set('int2', 'Integer'); +JavaTypeMap.set('int4', 'Integer'); JavaTypeMap.set('tinyint', 'Integer'); JavaTypeMap.set('smallint', 'Integer'); JavaTypeMap.set('integer', 'Integer'); JavaTypeMap.set('year', 'Integer'); JavaTypeMap.set('bigint', 'Long'); +JavaTypeMap.set('int8', 'Long'); JavaTypeMap.set('float', 'BigDecimal'); JavaTypeMap.set('double', 'BigDecimal'); JavaTypeMap.set('decimal', 'BigDecimal'); @@ -20,6 +24,7 @@ JavaTypeMap.set('longtext', 'String'); JavaTypeMap.set('blob', 'String'); JavaTypeMap.set('date', 'LocalDate'); JavaTypeMap.set('datetime', 'LocalDateTime'); +JavaTypeMap.set('timestamp', 'LocalDateTime'); export const JavaTypeList = [ 'Boolean', // @@ -39,7 +44,11 @@ export function getJavaType(dataType) { // -------------------------------- js 类型 -------------------------------- export const JsTypeMap = new Map(); JsTypeMap.set('bit', 'Boolean'); +JsTypeMap.set('bool', 'Boolean'); JsTypeMap.set('int', 'Number'); +JsTypeMap.set('int2', 'Number'); +JsTypeMap.set('int4', 'Number'); +JsTypeMap.set('int8', 'Number'); JsTypeMap.set('tinyint', 'Number'); JsTypeMap.set('smallint', 'Number'); JsTypeMap.set('integer', 'Number'); @@ -50,12 +59,14 @@ JsTypeMap.set('double', 'Number'); JsTypeMap.set('decimal', 'Number'); JsTypeMap.set('char', 'String'); JsTypeMap.set('varchar', 'String'); +JsTypeMap.set('character', 'String'); JsTypeMap.set('tinytext', 'String'); JsTypeMap.set('text', 'String'); JsTypeMap.set('longtext', 'String'); JsTypeMap.set('blob', 'String'); JsTypeMap.set('date', 'Date'); JsTypeMap.set('datetime', 'Date'); +JsTypeMap.set('timestamp', 'Date'); export const JsTypeList = [ 'Boolean', // @@ -72,17 +83,23 @@ export function getJsType(dataType) { export const FrontComponentMap = new Map(); FrontComponentMap.set('bit', 'BooleanSelect'); +FrontComponentMap.set('bool', 'BooleanSelect'); FrontComponentMap.set('int', 'InputNumber'); +FrontComponentMap.set('int2', 'InputNumber'); +FrontComponentMap.set('int4', 'InputNumber'); +FrontComponentMap.set('int8', 'InputNumber'); FrontComponentMap.set('tinyint', 'InputNumber'); FrontComponentMap.set('smallint', 'InputNumber'); FrontComponentMap.set('integer', 'InputNumber'); FrontComponentMap.set('year', 'Date'); +FrontComponentMap.set('timestamp', 'Date'); FrontComponentMap.set('bigint', 'InputNumber'); FrontComponentMap.set('float', 'InputNumber'); FrontComponentMap.set('double', 'InputNumber'); FrontComponentMap.set('decimal', 'InputNumber'); FrontComponentMap.set('char', 'Input'); FrontComponentMap.set('varchar', 'Input'); +FrontComponentMap.set('character', 'Input'); FrontComponentMap.set('tinytext', 'Input'); FrontComponentMap.set('text', 'Textarea'); FrontComponentMap.set('longtext', 'Textarea'); diff --git a/smart-admin-web-javascript/src/views/system/home/index.vue b/smart-admin-web-javascript/src/views/system/home/index.vue index 9847a1b..bca396d 100644 --- a/smart-admin-web-javascript/src/views/system/home/index.vue +++ b/smart-admin-web-javascript/src/views/system/home/index.vue @@ -52,14 +52,14 @@ - - - - + + + + diff --git a/smart-admin-web-typescript/src/views/support/code-generator/code-generator-util.ts b/smart-admin-web-typescript/src/views/support/code-generator/code-generator-util.ts index a942902..7961bbe 100644 --- a/smart-admin-web-typescript/src/views/support/code-generator/code-generator-util.ts +++ b/smart-admin-web-typescript/src/views/support/code-generator/code-generator-util.ts @@ -3,12 +3,16 @@ import { convertUpperCamel } from '/@/utils/str-util'; // -------------------------------- java 类型 -------------------------------- export const JavaTypeMap = new Map(); JavaTypeMap.set('bit', 'Boolean'); +JavaTypeMap.set('bool', 'Boolean'); JavaTypeMap.set('int', 'Integer'); +JavaTypeMap.set('int2', 'Integer'); +JavaTypeMap.set('int4', 'Integer'); JavaTypeMap.set('tinyint', 'Integer'); JavaTypeMap.set('smallint', 'Integer'); JavaTypeMap.set('integer', 'Integer'); JavaTypeMap.set('year', 'Integer'); JavaTypeMap.set('bigint', 'Long'); +JavaTypeMap.set('int8', 'Long'); JavaTypeMap.set('float', 'BigDecimal'); JavaTypeMap.set('double', 'BigDecimal'); JavaTypeMap.set('decimal', 'BigDecimal'); @@ -20,6 +24,7 @@ JavaTypeMap.set('longtext', 'String'); JavaTypeMap.set('blob', 'String'); JavaTypeMap.set('date', 'LocalDate'); JavaTypeMap.set('datetime', 'LocalDateTime'); +JavaTypeMap.set('timestamp', 'LocalDateTime'); export const JavaTypeList = [ 'Boolean', // @@ -39,7 +44,11 @@ export function getJavaType(dataType) { // -------------------------------- js 类型 -------------------------------- export const JsTypeMap = new Map(); JsTypeMap.set('bit', 'Boolean'); +JsTypeMap.set('bool', 'Boolean'); JsTypeMap.set('int', 'Number'); +JsTypeMap.set('int2', 'Number'); +JsTypeMap.set('int4', 'Number'); +JsTypeMap.set('int8', 'Number'); JsTypeMap.set('tinyint', 'Number'); JsTypeMap.set('smallint', 'Number'); JsTypeMap.set('integer', 'Number'); @@ -50,12 +59,14 @@ JsTypeMap.set('double', 'Number'); JsTypeMap.set('decimal', 'Number'); JsTypeMap.set('char', 'String'); JsTypeMap.set('varchar', 'String'); +JsTypeMap.set('character', 'String'); JsTypeMap.set('tinytext', 'String'); JsTypeMap.set('text', 'String'); JsTypeMap.set('longtext', 'String'); JsTypeMap.set('blob', 'String'); JsTypeMap.set('date', 'Date'); JsTypeMap.set('datetime', 'Date'); +JsTypeMap.set('timestamp', 'Date'); export const JsTypeList = [ 'Boolean', // @@ -72,17 +83,23 @@ export function getJsType(dataType) { export const FrontComponentMap = new Map(); FrontComponentMap.set('bit', 'BooleanSelect'); +FrontComponentMap.set('bool', 'BooleanSelect'); FrontComponentMap.set('int', 'InputNumber'); +FrontComponentMap.set('int2', 'InputNumber'); +FrontComponentMap.set('int4', 'InputNumber'); +FrontComponentMap.set('int8', 'InputNumber'); FrontComponentMap.set('tinyint', 'InputNumber'); FrontComponentMap.set('smallint', 'InputNumber'); FrontComponentMap.set('integer', 'InputNumber'); FrontComponentMap.set('year', 'Date'); +FrontComponentMap.set('timestamp', 'Date'); FrontComponentMap.set('bigint', 'InputNumber'); FrontComponentMap.set('float', 'InputNumber'); FrontComponentMap.set('double', 'InputNumber'); FrontComponentMap.set('decimal', 'InputNumber'); FrontComponentMap.set('char', 'Input'); FrontComponentMap.set('varchar', 'Input'); +FrontComponentMap.set('character', 'Input'); FrontComponentMap.set('tinytext', 'Input'); FrontComponentMap.set('text', 'Textarea'); FrontComponentMap.set('longtext', 'Textarea'); diff --git a/sql/README.md b/数据库SQL脚本/README.md similarity index 100% rename from sql/README.md rename to 数据库SQL脚本/README.md diff --git a/sql/smart_admin_v3.sql b/数据库SQL脚本/mysql/smart_admin_v3.sql similarity index 99% rename from sql/smart_admin_v3.sql rename to 数据库SQL脚本/mysql/smart_admin_v3.sql index 5838fda..61abaa4 100644 --- a/sql/smart_admin_v3.sql +++ b/数据库SQL脚本/mysql/smart_admin_v3.sql @@ -924,7 +924,7 @@ CREATE TABLE `t_operate_log` ( `url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '请求路径', `method` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '请求方法', `param` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '请求参数', - `response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '请求参数', + `response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '返回值', `ip` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '请求ip', `ip_region` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '请求ip地区', `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '请求user-agent', diff --git a/sql/sql-update-log/v3.15.0.sql b/数据库SQL脚本/mysql/sql-update-log/v3.15.0.sql similarity index 100% rename from sql/sql-update-log/v3.15.0.sql rename to 数据库SQL脚本/mysql/sql-update-log/v3.15.0.sql diff --git a/sql/sql-update-log/v3.18.0.sql b/数据库SQL脚本/mysql/sql-update-log/v3.18.0.sql similarity index 100% rename from sql/sql-update-log/v3.18.0.sql rename to 数据库SQL脚本/mysql/sql-update-log/v3.18.0.sql diff --git a/sql/sql-update-log/v3.21.0.sql b/数据库SQL脚本/mysql/sql-update-log/v3.21.0.sql similarity index 100% rename from sql/sql-update-log/v3.21.0.sql rename to 数据库SQL脚本/mysql/sql-update-log/v3.21.0.sql diff --git a/sql/sql-update-log/v3.23.0.sql b/数据库SQL脚本/mysql/sql-update-log/v3.23.0.sql similarity index 100% rename from sql/sql-update-log/v3.23.0.sql rename to 数据库SQL脚本/mysql/sql-update-log/v3.23.0.sql diff --git a/sql/sql-update-log/v3.25.0.sql b/数据库SQL脚本/mysql/sql-update-log/v3.25.0.sql similarity index 100% rename from sql/sql-update-log/v3.25.0.sql rename to 数据库SQL脚本/mysql/sql-update-log/v3.25.0.sql diff --git a/sql/sql-update-log/v3.26.0.sql b/数据库SQL脚本/mysql/sql-update-log/v3.26.0.sql similarity index 100% rename from sql/sql-update-log/v3.26.0.sql rename to 数据库SQL脚本/mysql/sql-update-log/v3.26.0.sql diff --git a/数据库SQL脚本/postgresql/README.md b/数据库SQL脚本/postgresql/README.md new file mode 100644 index 0000000..4efdec8 --- /dev/null +++ b/数据库SQL脚本/postgresql/README.md @@ -0,0 +1,9 @@ + + +## 主流 + +序号| 数据库 | 状态 | 下载 +-------- |-------------------------------------------|-------------------| ----- +1| [Mysql](https://www.mysql.com) | Java8+Java17 都支持 ✔️ | +2| [PostgreSQL](https://www.postgresql.org/) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) + diff --git a/数据库SQL脚本/国产数据库/OceanBase/README.md b/数据库SQL脚本/国产数据库/OceanBase/README.md new file mode 100644 index 0000000..fa70062 --- /dev/null +++ b/数据库SQL脚本/国产数据库/OceanBase/README.md @@ -0,0 +1,11 @@ + + +## 国产数据库支持 + +序号| 数据库 | 支持 | 下载 +-------- |---------------------------------------------------| ----- | ---- +1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) +2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) + + + diff --git a/数据库SQL脚本/国产数据库/人大金仓/README.md b/数据库SQL脚本/国产数据库/人大金仓/README.md new file mode 100644 index 0000000..fa70062 --- /dev/null +++ b/数据库SQL脚本/国产数据库/人大金仓/README.md @@ -0,0 +1,11 @@ + + +## 国产数据库支持 + +序号| 数据库 | 支持 | 下载 +-------- |---------------------------------------------------| ----- | ---- +1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) +2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) + + + diff --git a/数据库SQL脚本/国产数据库/南大通用/README.md b/数据库SQL脚本/国产数据库/南大通用/README.md new file mode 100644 index 0000000..fa70062 --- /dev/null +++ b/数据库SQL脚本/国产数据库/南大通用/README.md @@ -0,0 +1,11 @@ + + +## 国产数据库支持 + +序号| 数据库 | 支持 | 下载 +-------- |---------------------------------------------------| ----- | ---- +1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) +2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) + + + diff --git a/数据库SQL脚本/国产数据库/腾讯TDSQL/README.md b/数据库SQL脚本/国产数据库/腾讯TDSQL/README.md new file mode 100644 index 0000000..fa70062 --- /dev/null +++ b/数据库SQL脚本/国产数据库/腾讯TDSQL/README.md @@ -0,0 +1,11 @@ + + +## 国产数据库支持 + +序号| 数据库 | 支持 | 下载 +-------- |---------------------------------------------------| ----- | ---- +1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) +2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) + + + diff --git a/数据库SQL脚本/国产数据库/达梦/README.md b/数据库SQL脚本/国产数据库/达梦/README.md new file mode 100644 index 0000000..fa70062 --- /dev/null +++ b/数据库SQL脚本/国产数据库/达梦/README.md @@ -0,0 +1,11 @@ + + +## 国产数据库支持 + +序号| 数据库 | 支持 | 下载 +-------- |---------------------------------------------------| ----- | ---- +1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) +2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) + + + diff --git a/数据库SQL脚本/国产数据库/阿里PolarDB/README.md b/数据库SQL脚本/国产数据库/阿里PolarDB/README.md new file mode 100644 index 0000000..fa70062 --- /dev/null +++ b/数据库SQL脚本/国产数据库/阿里PolarDB/README.md @@ -0,0 +1,11 @@ + + +## 国产数据库支持 + +序号| 数据库 | 支持 | 下载 +-------- |---------------------------------------------------| ----- | ---- +1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) +2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) + + + diff --git a/数据库SQL脚本/国产数据库/高斯GaussDB/README.md b/数据库SQL脚本/国产数据库/高斯GaussDB/README.md new file mode 100644 index 0000000..fa70062 --- /dev/null +++ b/数据库SQL脚本/国产数据库/高斯GaussDB/README.md @@ -0,0 +1,11 @@ + + +## 国产数据库支持 + +序号| 数据库 | 支持 | 下载 +-------- |---------------------------------------------------| ----- | ---- +1| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) +2| [电科(人大)金仓KingBaseES](https://www.kingbase.com.cn) | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/) + + +