perf:调整表结构

This commit is contained in:
曾文豪
2024-11-21 15:21:58 +08:00
parent 2f6b5b0b05
commit b15dbc6d4c
5 changed files with 39 additions and 11 deletions

View File

@@ -17,7 +17,8 @@ CREATE TABLE `core_log_login`
`address` varchar(255) DEFAULT NULL COMMENT 'ip地址', `address` varchar(255) DEFAULT NULL COMMENT 'ip地址',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-登录'; DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='日志-登录';
-- ---------------------------- -- ----------------------------
-- Table structure for core_platform_unique -- Table structure for core_platform_unique
@@ -35,6 +36,7 @@ CREATE TABLE `core_platform_unique`
`info` text COMMENT '其他参数', `info` text COMMENT '其他参数',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='平台-唯一值'; DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='平台-唯一值';
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -24,6 +24,7 @@ create table core_role_authority
ext3 varchar(500) null comment '扩展3' ext3 varchar(500) null comment '扩展3'
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci
comment '角色-权限'; comment '角色-权限';
create table core_role_group create table core_role_group
@@ -43,6 +44,7 @@ create table core_role_group
ext3 varchar(500) null comment '扩展3' ext3 varchar(500) null comment '扩展3'
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci
comment '角色-分组'; comment '角色-分组';
create table core_role_group_rx create table core_role_group_rx
@@ -56,6 +58,7 @@ create table core_role_group_rx
menu_id varchar(50) not null comment '菜单id' menu_id varchar(50) not null comment '菜单id'
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci
comment '角色-分组-关系'; comment '角色-分组-关系';
create table core_role_server create table core_role_server
@@ -76,6 +79,7 @@ create table core_role_server
ext3 varchar(500) null comment '扩展3' ext3 varchar(500) null comment '扩展3'
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci
comment '角色-服务'; comment '角色-服务';
create table core_role_user create table core_role_user
@@ -94,6 +98,7 @@ create table core_role_user
ext3 varchar(500) null comment '扩展3' ext3 varchar(500) null comment '扩展3'
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci
comment '角色-用户'; comment '角色-用户';
alter table core_role_authority alter table core_role_authority

View File

@@ -95,12 +95,13 @@ public class GlobalConfig {
/** /**
* 重定向 * 构建待版本号的路径
* *
* @param htmlDir 资源目录 * @param htmlDir
* @param route * @param route
* @return
*/ */
public void redirectWithVer(String htmlDir, String route, HttpServletResponse response) { public String buildByVersion(String htmlDir, String route) {
if (!StrUtil.endWith(htmlDir, "/")) { if (!StrUtil.endWith(htmlDir, "/")) {
htmlDir = htmlDir + "/"; htmlDir = htmlDir + "/";
} }
@@ -129,15 +130,31 @@ public class GlobalConfig {
throw new ApiException("无法重定向,请检查资源"); throw new ApiException("无法重定向,请检查资源");
} }
CollUtil.sort(versions, (o1, o2) -> -VersionComparator.INSTANCE.compare(o1, o2)); CollUtil.sort(versions, (o1, o2) -> -VersionComparator.INSTANCE.compare(o1, o2));
String path = buildPath(String.format("/%s%s/index.html#%s", htmlDir, versions.get(0), route)); return buildPath(String.format("/%s%s/index.html#%s", htmlDir, versions.get(0), route));
response.sendRedirect(path);
} catch (IOException e) { } catch (IOException e) {
LogFactory.get().info(e); LogFactory.get().info(e);
} }
return "";
} }
/**
* 重定向
*
* @param htmlDir 资源目录
* @param route
*/
public void redirectWithVer(String htmlDir, String route, HttpServletResponse response) {
try {
response.sendRedirect(buildByVersion(htmlDir, route));
} catch (Exception ignored) {
}
}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// setter\getter // setter\getter
/// //////////////////////////////////////////////////////////////////////// /// ////////////////////////////////////////////////////////////////////////

View File

@@ -13,7 +13,8 @@ CREATE TABLE `core_config_enum`
`ext` varchar(255) DEFAULT NULL COMMENT '扩展字段', `ext` varchar(255) DEFAULT NULL COMMENT '扩展字段',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='配置-枚举'; DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='配置-枚举';
CREATE TABLE `core_config_system` CREATE TABLE `core_config_system`
@@ -31,7 +32,8 @@ CREATE TABLE `core_config_system`
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `uni_key` (`config_key`(50)) USING BTREE UNIQUE KEY `uni_key` (`config_key`(50)) USING BTREE
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='配置-系统'; DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='配置-系统';
alter table core_config_enum alter table core_config_enum
add sort int(10) not null default 0 comment '排序' after name; add sort int(10) not null default 0 comment '排序' after name;

View File

@@ -18,6 +18,7 @@ CREATE TABLE `core_log_api`
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci
ROW_FORMAT = DYNAMIC COMMENT ='日志-调用'; ROW_FORMAT = DYNAMIC COMMENT ='日志-调用';
-- ---------------------------- -- ----------------------------
@@ -69,7 +70,8 @@ CREATE TABLE `core_log_operation`
`params` longtext COMMENT '其他参数', `params` longtext COMMENT '其他参数',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-操作'; DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_general_ci COMMENT ='日志-操作';
alter table core_log_process alter table core_log_process