提交 a22bf199 作者: 方治民

fix: 修复因变更主键数据类型导致的查询异常问题、更新示例 sql 脚本文件

上级 9ffc3622
......@@ -40,7 +40,7 @@ public class Auths {
throw NotLoginException.newInstance(StpUtil.TYPE, null);
}
Optional<User> optional = userRepository.findById(Long.valueOf(Objects.toString(id)));
Optional<User> optional = userRepository.findById(Objects.toString(id));
if (optional.isEmpty()) {
StpUtil.logout(id);
throw NotLoginException.newInstance(StpUtil.TYPE, NotLoginException.INVALID_TOKEN);
......
......@@ -22,7 +22,7 @@ SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
`id` bigint NOT NULL COMMENT '主键',
`id` varchar(255) NOT NULL COMMENT '主键',
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '最后修改时间',
`component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '组件',
......@@ -32,7 +32,7 @@ CREATE TABLE `sys_permission` (
`meta` json NULL COMMENT '扩展元数据信息',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '路径',
`pid` bigint NULL DEFAULT NULL COMMENT '权限父级ID',
`pid` varchar(255) NULL DEFAULT NULL COMMENT '权限父级ID',
`redirect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '重定向',
`serial` int NULL DEFAULT NULL COMMENT '序号',
`tree` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '树节点标识',
......@@ -49,17 +49,17 @@ CREATE TABLE `sys_permission` (
-- ----------------------------
-- Records of sys_permission
-- ----------------------------
INSERT INTO `sys_permission` VALUES (1515550180340928512, '2022-04-17 12:38:15.212000', '2022-04-17 12:38:15.212000', 'LAYOUT', b'1', NULL, 'ion:grid-outline', '{\"title\": \"routes.dashboard.dashboard\", \"hideChildrenInMenu\": true}', 'Dashboard', '/dashboard', 0, '/dashboard/workbench', 1, '0', 'MENU', 'Dashboard');
INSERT INTO `sys_permission` VALUES (1515627442394370048, '2022-04-17 17:45:15.941000', '2022-04-17 17:45:15.941000', '/dashboard/workbench/index', b'1', b'1', NULL, '{\"title\": \"routes.dashboard.workbench\", \"hideBreadcrumb\": true, \"currentActiveMenu\": \"/dashboard\", \"hideChildrenInMenu\": true}', 'Workbench', 'workbench', 1515550180340928512, NULL, 1, '0.1515550180340928512', 'MENU', 'Workbench');
INSERT INTO `sys_permission` VALUES (1515627944716800000, '2022-04-17 17:47:15.683000', '2022-04-17 17:47:15.683000', 'LAYOUT', b'1', NULL, 'simple-icons:about-dot-me', '{\"title\": \"routes.dashboard.about\", \"hideChildrenInMenu\": true}', 'About', '/about', 0, '/about/index', 100000, '0', 'MENU', 'About');
INSERT INTO `sys_permission` VALUES (1515628470086930432, '2022-04-17 17:49:20.941000', '2022-04-17 17:49:20.942000', '/sys/about/index', b'1', NULL, 'simple-icons:about-dot-me', '{\"title\": \"routes.dashboard.about\", \"hideMenu\": true}', 'AboutPage', 'index', 1515627944716800000, NULL, NULL, '0.1515627944716800000', 'MENU', 'AboutPage');
INSERT INTO `sys_permission` VALUES ('1515550180340928512', '2022-04-17 12:38:15.212000', '2022-04-17 12:38:15.212000', 'LAYOUT', b'1', NULL, 'ion:grid-outline', '{\"title\": \"routes.dashboard.dashboard\", \"hideChildrenInMenu\": true}', 'Dashboard', '/dashboard', 0, '/dashboard/workbench', 1, '0', 'MENU', 'Dashboard');
INSERT INTO `sys_permission` VALUES ('1515627442394370048', '2022-04-17 17:45:15.941000', '2022-04-17 17:45:15.941000', '/dashboard/workbench/index', b'1', b'1', NULL, '{\"title\": \"routes.dashboard.workbench\", \"hideBreadcrumb\": true, \"currentActiveMenu\": \"/dashboard\", \"hideChildrenInMenu\": true}', 'Workbench', 'workbench', '1515550180340928512', NULL, 1, '0.1515550180340928512', 'MENU', 'Workbench');
INSERT INTO `sys_permission` VALUES ('1515627944716800000', '2022-04-17 17:47:15.683000', '2022-04-17 17:47:15.683000', 'LAYOUT', b'1', NULL, 'simple-icons:about-dot-me', '{\"title\": \"routes.dashboard.about\", \"hideChildrenInMenu\": true}', 'About', '/about', 0, '/about/index', 100000, '0', 'MENU', 'About');
INSERT INTO `sys_permission` VALUES ('1515628470086930432', '2022-04-17 17:49:20.941000', '2022-04-17 17:49:20.942000', '/sys/about/index', b'1', NULL, 'simple-icons:about-dot-me', '{\"title\": \"routes.dashboard.about\", \"hideMenu\": true}', 'AboutPage', 'index', '1515627944716800000', NULL, NULL, '0.1515627944716800000', 'MENU', 'AboutPage');
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
`id` bigint NOT NULL COMMENT '主键',
`id` varchar(255) NOT NULL COMMENT '主键',
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '最后修改时间',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称',
......@@ -72,15 +72,15 @@ CREATE TABLE `sys_role` (
-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT INTO `sys_role` VALUES (1515628618854699008, '2022-04-17 17:49:56.420000', '2022-04-17 17:51:12.854000', '超级管理员', 'admin');
INSERT INTO `sys_role` VALUES ('1515628618854699008', '2022-04-17 17:49:56.420000', '2022-04-17 17:51:12.854000', '超级管理员', 'admin');
-- ----------------------------
-- Table structure for sys_role_permissions
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permissions`;
CREATE TABLE `sys_role_permissions` (
`role_id` bigint NOT NULL,
`permissions_id` bigint NOT NULL,
`role_id` varchar(255) NOT NULL,
`permissions_id` varchar(255) NOT NULL,
PRIMARY KEY (`role_id`, `permissions_id`) USING BTREE,
INDEX `FKrg8k5oymm622ik067yjss31co`(`permissions_id`) USING BTREE,
CONSTRAINT `FKaa4k4qhr2qdj6br8p5nrb2lhb` FOREIGN KEY (`role_id`) REFERENCES `sys_role` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
......@@ -90,17 +90,17 @@ CREATE TABLE `sys_role_permissions` (
-- ----------------------------
-- Records of sys_role_permissions
-- ----------------------------
INSERT INTO `sys_role_permissions` VALUES (1515628618854699008, 1515550180340928512);
INSERT INTO `sys_role_permissions` VALUES (1515628618854699008, 1515627442394370048);
INSERT INTO `sys_role_permissions` VALUES (1515628618854699008, 1515627944716800000);
INSERT INTO `sys_role_permissions` VALUES (1515628618854699008, 1515628470086930432);
INSERT INTO `sys_role_permissions` VALUES ('1515628618854699008', '1515550180340928512');
INSERT INTO `sys_role_permissions` VALUES ('1515628618854699008', '1515627442394370048');
INSERT INTO `sys_role_permissions` VALUES ('1515628618854699008', '1515627944716800000');
INSERT INTO `sys_role_permissions` VALUES ('1515628618854699008', '1515628470086930432');
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`id` bigint NOT NULL COMMENT '主键',
`id` varchar(255) NOT NULL COMMENT '主键',
`create_time` datetime(6) NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime(6) NULL DEFAULT NULL COMMENT '最后修改时间',
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '头像',
......@@ -128,15 +128,15 @@ CREATE TABLE `sys_user` (
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT INTO `sys_user` VALUES (1515549486414303232, '2022-04-17 12:35:29.860000', '2022-04-17 17:55:47.785000', 'https://s1.ax1x.com/2022/03/30/qggJH0.jpg', b'0', NULL, b'1', '平台管理员', '0:0:0:0:0:0:0:1', '2022-04-17 17:55:47.784000', '13012345678', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', '管理员', 'admin');
INSERT INTO `sys_user` VALUES ('1515549486414303232', '2022-04-17 12:35:29.860000', '2022-04-17 17:55:47.785000', 'https://s1.ax1x.com/2022/03/30/qggJH0.jpg', b'0', NULL, b'1', '平台管理员', '0:0:0:0:0:0:0:1', '2022-04-17 17:55:47.784000', '13012345678', '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92', '管理员', 'admin');
-- ----------------------------
-- Table structure for sys_user_roles
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_roles`;
CREATE TABLE `sys_user_roles` (
`user_id` bigint NOT NULL,
`role_id` bigint NOT NULL,
`user_id` varchar(255) NOT NULL,
`role_id` varchar(255) NOT NULL,
PRIMARY KEY (`role_id`, `user_id`) USING BTREE,
INDEX `FKp2804vh0ea810pitigxq5n6pn`(`user_id`) USING BTREE,
CONSTRAINT `FKp2804vh0ea810pitigxq5n6pn` FOREIGN KEY (`user_id`) REFERENCES `sys_user` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
......@@ -146,7 +146,7 @@ CREATE TABLE `sys_user_roles` (
-- ----------------------------
-- Records of sys_user_roles
-- ----------------------------
INSERT INTO `sys_user_roles` VALUES (1515549486414303232, 1515628618854699008);
INSERT INTO `sys_user_roles` VALUES ('1515549486414303232', '1515628618854699008');
-- ----------------------------
-- Table structure for test_table
......
......@@ -29,7 +29,7 @@ public class PidParam implements Serializable {
@Serial
private static final long serialVersionUID = -8690942241103456893L;
@ApiModelProperty(value = "pid", example = "1", required = true)
@ApiModelProperty(value = "pid", example = "0", required = true)
@NotNull(message = "pid 不能为空")
String pid;
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论