From f36dda74a1ba079e75d33099db26b3615fc92e74 Mon Sep 17 00:00:00 2001 From: l90215 Date: Sat, 2 Aug 2025 19:37:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E9=80=BB=E8=BE=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/SysUserMapper.xml | 2 +- script/sql/ruoyi-ai.sql | 61 +++++++++++++++++++ ...wledge-role.sql => knowledge-role-bak.sql} | 0 3 files changed, 62 insertions(+), 1 deletion(-) rename script/sql/update/{knowledge-role.sql => knowledge-role-bak.sql} (100%) diff --git a/ruoyi-modules-api/ruoyi-system-api/src/main/resources/mapper/SysUserMapper.xml b/ruoyi-modules-api/ruoyi-system-api/src/main/resources/mapper/SysUserMapper.xml index d5ce95b9..e4cd5887 100644 --- a/ruoyi-modules-api/ruoyi-system-api/src/main/resources/mapper/SysUserMapper.xml +++ b/ruoyi-modules-api/ruoyi-system-api/src/main/resources/mapper/SysUserMapper.xml @@ -45,7 +45,7 @@ u.create_time, u.remark, u.krole_group_type, - u.krole_group_ids, + u.krole_group_id, d.dept_id, d.parent_id, d.ancestors, diff --git a/script/sql/ruoyi-ai.sql b/script/sql/ruoyi-ai.sql index ce1cde14..f08b8b41 100644 --- a/script/sql/ruoyi-ai.sql +++ b/script/sql/ruoyi-ai.sql @@ -1438,6 +1438,11 @@ CREATE TABLE `sys_user` ( PRIMARY KEY (`user_id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户信息表' ROW_FORMAT = Dynamic; +-- 用户表添加字段 +ALTER TABLE sys_user + ADD COLUMN `krole_group_type` VARCHAR(50) COMMENT '关联知识库角色/角色组', +ADD COLUMN `krole_group_ids` TEXT COMMENT '关联知识库角色/角色组id'; + -- ---------------------------- -- Records of sys_user -- ---------------------------- @@ -2637,4 +2642,60 @@ INSERT INTO dev_schema_group (id, name, code, icon, sort, status, remark, del_fl INSERT INTO dev_schema_group (id, name, code, icon, sort, status, remark, del_flag, tenant_id, create_dept, create_by, create_time, update_by, update_time) VALUES (1944346023254429697, '在线开发', 'dev', 'carbon:development', 3, '0', null, '0', '000000', null, null, '2025-07-13 18:39:51', 1, '2025-07-13 18:42:07'); + + + +-- ---------------------------- +-- Table structure for knowledge_role +-- ---------------------------- +DROP TABLE IF EXISTS `knowledge_role`; +CREATE TABLE `knowledge_role` ( + `id` bigint NOT NULL COMMENT '知识库角色id', + `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '知识库角色name', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `group_id` bigint NULL DEFAULT NULL COMMENT '知识库角色组id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识库角色表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for knowledge_role_group +-- ---------------------------- +DROP TABLE IF EXISTS `knowledge_role_group`; +CREATE TABLE `knowledge_role_group` ( + `id` bigint NOT NULL COMMENT '知识库角色组id', + `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '知识库角色组name', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识库角色组表' ROW_FORMAT = DYNAMIC; + +-- ---------------------------- +-- Table structure for knowledge_role_relation +-- ---------------------------- +DROP TABLE IF EXISTS `knowledge_role_relation`; +CREATE TABLE `knowledge_role_relation` ( + `id` bigint NOT NULL COMMENT 'id', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', + `create_by` bigint NULL DEFAULT NULL COMMENT '创建者', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `update_by` bigint NULL DEFAULT NULL COMMENT '更新者', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注', + `knowledge_role_id` bigint NULL DEFAULT NULL COMMENT '知识库角色id', + `knowledge_id` bigint NULL DEFAULT NULL COMMENT '知识库id', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '知识库角色与知识库关联表' ROW_FORMAT = DYNAMIC; + SET FOREIGN_KEY_CHECKS = 1; diff --git a/script/sql/update/knowledge-role.sql b/script/sql/update/knowledge-role-bak.sql similarity index 100% rename from script/sql/update/knowledge-role.sql rename to script/sql/update/knowledge-role-bak.sql From b003e1b3bb0ae87e1e74e877684ca53e934d1aff Mon Sep 17 00:00:00 2001 From: l90215 Date: Sat, 2 Aug 2025 19:38:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=AD=97=E6=AE=B5=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/SysUserMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-modules-api/ruoyi-system-api/src/main/resources/mapper/SysUserMapper.xml b/ruoyi-modules-api/ruoyi-system-api/src/main/resources/mapper/SysUserMapper.xml index e4cd5887..d5ce95b9 100644 --- a/ruoyi-modules-api/ruoyi-system-api/src/main/resources/mapper/SysUserMapper.xml +++ b/ruoyi-modules-api/ruoyi-system-api/src/main/resources/mapper/SysUserMapper.xml @@ -45,7 +45,7 @@ u.create_time, u.remark, u.krole_group_type, - u.krole_group_id, + u.krole_group_ids, d.dept_id, d.parent_id, d.ancestors,