From d31b278f21b37e1c80583f9d5c431e218b7aa7c3 Mon Sep 17 00:00:00 2001 From: "DESKTOP-72TV0V4\\caoxiaozhu" Date: Sun, 8 Mar 2026 16:55:59 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B8=85=E7=90=86=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E9=85=8D=E7=BD=AE=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=96=B0=E9=9C=80=E6=B1=82=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除旧的数据库连接配置文件 - 添加上传 API 需求文档 - 添加知识库 API 需求文档 Co-Authored-By: Claude Opus 4.6 --- .../053388bf-d0c3-4cd9-b78f-539858705a65.json | 7 - .../101fbee1-8400-46ae-b83b-e3898e4888b6.json | 22 -- .../1ee87735-9ddd-4831-85ce-c1a571ab996b.json | 22 -- .../44cf2f22-fccb-4dd0-92fb-02d613ce2624.json | 22 -- .../456b6a60-c5a5-46e4-8f5e-9c07c4c08510.json | 20 - .../4e3ce862-5936-45f8-baf2-c9c2895c2303.json | 22 -- .../58f7171d-6906-4f85-b27a-20bb2f982fc4.json | 22 -- .../5eee8840-c268-4cf1-8f86-a0d13eaf9b16.json | 21 -- .../68b6fb60-eae2-495b-b248-9c46c8d8d6cb.json | 21 -- .../7eb66808-db8b-428e-8548-2f754c4fc688.json | 44 --- .../96d39e69-c96b-4d22-9b29-6456de71c6c1.json | 21 -- .../a58e6c1e-b39b-4248-8de9-b172f134197b.json | 21 -- .../a89dfc3e-5089-4a9e-8f6b-991d5bebd85d.json | 36 -- .../b5fc80da-b681-4f6f-a35a-73e73dee50d0.json | 20 - .../d022a68d-cb75-405b-bee3-e923a8b5a283.json | 7 - .../d44fa121-5964-439f-8c5d-0384ba27b411.json | 22 -- team-require/api/upload-api.md | 96 +++++ team-require/web/knowledge-base-api.md | 354 ++++++++++++++++++ .../{todo-2026-3-7.md => todo-2026-3-8.md} | 10 + 19 files changed, 460 insertions(+), 350 deletions(-) delete mode 100644 server/resources/db_info/053388bf-d0c3-4cd9-b78f-539858705a65.json delete mode 100644 server/resources/db_info/101fbee1-8400-46ae-b83b-e3898e4888b6.json delete mode 100644 server/resources/db_info/1ee87735-9ddd-4831-85ce-c1a571ab996b.json delete mode 100644 server/resources/db_info/44cf2f22-fccb-4dd0-92fb-02d613ce2624.json delete mode 100644 server/resources/db_info/456b6a60-c5a5-46e4-8f5e-9c07c4c08510.json delete mode 100644 server/resources/db_info/4e3ce862-5936-45f8-baf2-c9c2895c2303.json delete mode 100644 server/resources/db_info/58f7171d-6906-4f85-b27a-20bb2f982fc4.json delete mode 100644 server/resources/db_info/5eee8840-c268-4cf1-8f86-a0d13eaf9b16.json delete mode 100644 server/resources/db_info/68b6fb60-eae2-495b-b248-9c46c8d8d6cb.json delete mode 100644 server/resources/db_info/7eb66808-db8b-428e-8548-2f754c4fc688.json delete mode 100644 server/resources/db_info/96d39e69-c96b-4d22-9b29-6456de71c6c1.json delete mode 100644 server/resources/db_info/a58e6c1e-b39b-4248-8de9-b172f134197b.json delete mode 100644 server/resources/db_info/a89dfc3e-5089-4a9e-8f6b-991d5bebd85d.json delete mode 100644 server/resources/db_info/b5fc80da-b681-4f6f-a35a-73e73dee50d0.json delete mode 100644 server/resources/db_info/d022a68d-cb75-405b-bee3-e923a8b5a283.json delete mode 100644 server/resources/db_info/d44fa121-5964-439f-8c5d-0384ba27b411.json create mode 100644 team-require/api/upload-api.md create mode 100644 team-require/web/knowledge-base-api.md rename team-require/web/{todo-2026-3-7.md => todo-2026-3-8.md} (75%) diff --git a/server/resources/db_info/053388bf-d0c3-4cd9-b78f-539858705a65.json b/server/resources/db_info/053388bf-d0c3-4cd9-b78f-539858705a65.json deleted file mode 100644 index 8816488..0000000 --- a/server/resources/db_info/053388bf-d0c3-4cd9-b78f-539858705a65.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "database_id": "053388bf-d0c3-4cd9-b78f-539858705a65", - "database_name": "test-db", - "db_type": "mysql", - "tables": [], - "updated_at": "2026-03-06T15:46:22.8598923+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/101fbee1-8400-46ae-b83b-e3898e4888b6.json b/server/resources/db_info/101fbee1-8400-46ae-b83b-e3898e4888b6.json deleted file mode 100644 index 570515e..0000000 --- a/server/resources/db_info/101fbee1-8400-46ae-b83b-e3898e4888b6.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "database_id": "101fbee1-8400-46ae-b83b-e3898e4888b6", - "database_name": "123", - "db_type": "mysql", - "tables": [ - { - "id": "042db4ca-512f-4ee9-aacb-2d7ff1bc2193", - "database_id": "101fbee1-8400-46ae-b83b-e3898e4888b6", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "fields": null, - "ddl": "CREATE TABLE `scores` (\n`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '分数id'\n `student_id` int(10) unsigned NOT NULL,\n `subject` varchar(50) NOT NULL COMMENT '科目',\n `score` double DEFAULT NULL COMMENT '分数',\n `teacher_id` int(10) unsigned DEFAULT NULL,\n `exam_date` date DEFAULT NULL COMMENT '考试日期',\n `created_at` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4", - "created_at": "2026-03-06T16:23:31.097+08:00", - "updated_at": "2026-03-06T16:23:31.097+08:00" - } - ], - "updated_at": "2026-03-06T16:23:31.1477776+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/1ee87735-9ddd-4831-85ce-c1a571ab996b.json b/server/resources/db_info/1ee87735-9ddd-4831-85ce-c1a571ab996b.json deleted file mode 100644 index adac063..0000000 --- a/server/resources/db_info/1ee87735-9ddd-4831-85ce-c1a571ab996b.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "database_id": "1ee87735-9ddd-4831-85ce-c1a571ab996b", - "database_name": "1231", - "db_type": "mysql", - "tables": [ - { - "id": "4402a7c4-7ff4-4084-a76b-4b7e0a34695c", - "database_id": "1ee87735-9ddd-4831-85ce-c1a571ab996b", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "fields": null, - "ddl": "CREATE TABLE `scores` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `student_id` int(10) unsigned NOT NULL,\n `subject` varchar(50) NOT NULL COMMENT '科目',\n `score` double DEFAULT NULL COMMENT '分数',\n `teacher_id` int(10) unsigned DEFAULT NULL,\n `exam_date` date DEFAULT NULL COMMENT '考试日期',\n `created_at` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4", - "created_at": "2026-03-07T10:33:25.752+08:00", - "updated_at": "2026-03-07T10:33:25.752+08:00" - } - ], - "updated_at": "2026-03-07T10:33:25.8031128+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/44cf2f22-fccb-4dd0-92fb-02d613ce2624.json b/server/resources/db_info/44cf2f22-fccb-4dd0-92fb-02d613ce2624.json deleted file mode 100644 index b647152..0000000 --- a/server/resources/db_info/44cf2f22-fccb-4dd0-92fb-02d613ce2624.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "database_id": "44cf2f22-fccb-4dd0-92fb-02d613ce2624", - "database_name": "1231", - "db_type": "mysql", - "tables": [ - { - "id": "042fb35c-9023-40ed-8d3a-cec24f0709a2", - "database_id": "44cf2f22-fccb-4dd0-92fb-02d613ce2624", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "fields": null, - "ddl": "CREATE TABLE `scores` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `student_id` int(10) unsigned NOT NULL,\n `subject` varchar(50) NOT NULL COMMENT '科目',\n `score` double DEFAULT NULL COMMENT '分数',\n `teacher_id` int(10) unsigned DEFAULT NULL,\n `exam_date` date DEFAULT NULL COMMENT '考试日期',\n `created_at` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4", - "created_at": "2026-03-07T09:59:48.436+08:00", - "updated_at": "2026-03-07T09:59:48.436+08:00" - } - ], - "updated_at": "2026-03-07T09:59:48.4882963+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/456b6a60-c5a5-46e4-8f5e-9c07c4c08510.json b/server/resources/db_info/456b6a60-c5a5-46e4-8f5e-9c07c4c08510.json deleted file mode 100644 index 883d481..0000000 --- a/server/resources/db_info/456b6a60-c5a5-46e4-8f5e-9c07c4c08510.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "database_id": "456b6a60-c5a5-46e4-8f5e-9c07c4c08510", - "database_name": "123", - "db_type": "mysql", - "tables": [ - { - "id": "8b7f6a2f-3788-4499-8d3a-fe9140ccdfe1", - "database_id": "456b6a60-c5a5-46e4-8f5e-9c07c4c08510", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "created_at": "2026-03-06T15:12:45.607+08:00", - "updated_at": "2026-03-06T15:12:45.607+08:00" - } - ], - "updated_at": "2026-03-06T15:12:45.6597943+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/4e3ce862-5936-45f8-baf2-c9c2895c2303.json b/server/resources/db_info/4e3ce862-5936-45f8-baf2-c9c2895c2303.json deleted file mode 100644 index 893067b..0000000 --- a/server/resources/db_info/4e3ce862-5936-45f8-baf2-c9c2895c2303.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "database_id": "4e3ce862-5936-45f8-baf2-c9c2895c2303", - "database_name": "1231", - "db_type": "mysql", - "tables": [ - { - "id": "f394a250-623b-4da0-81e5-1e5d93bed982", - "database_id": "4e3ce862-5936-45f8-baf2-c9c2895c2303", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "fields": null, - "ddl": "CREATE TABLE `scores` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `student_id` int(10) unsigned NOT NULL,\n `subject` varchar(50) NOT NULL COMMENT '科目',\n `score` double DEFAULT NULL COMMENT '分数',\n `teacher_id` int(10) unsigned DEFAULT NULL,\n `exam_date` date DEFAULT NULL COMMENT '考试日期',\n `created_at` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4", - "created_at": "2026-03-07T10:37:08.868+08:00", - "updated_at": "2026-03-07T10:37:08.868+08:00" - } - ], - "updated_at": "2026-03-07T10:37:08.918463+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/58f7171d-6906-4f85-b27a-20bb2f982fc4.json b/server/resources/db_info/58f7171d-6906-4f85-b27a-20bb2f982fc4.json deleted file mode 100644 index 970dbed..0000000 --- a/server/resources/db_info/58f7171d-6906-4f85-b27a-20bb2f982fc4.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "database_id": "58f7171d-6906-4f85-b27a-20bb2f982fc4", - "database_name": "123", - "db_type": "mysql", - "tables": [ - { - "id": "12298a11-fe00-4e6a-a37e-e4c0b5de6a51", - "database_id": "58f7171d-6906-4f85-b27a-20bb2f982fc4", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "fields": null, - "ddl": "CREATE TABLE `scores` (\n`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'fenshu id'\n `student_id` int(10) unsigned NOT NULL,\n `subject` varchar(50) NOT NULL COMMENT '科目',\n `score` double DEFAULT NULL COMMENT '分数',\n `teacher_id` int(10) unsigned DEFAULT NULL,\n `exam_date` date DEFAULT NULL COMMENT '考试日期',\n `created_at` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4", - "created_at": "2026-03-06T16:26:15.44+08:00", - "updated_at": "2026-03-06T16:26:15.44+08:00" - } - ], - "updated_at": "2026-03-06T16:26:15.4936638+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/5eee8840-c268-4cf1-8f86-a0d13eaf9b16.json b/server/resources/db_info/5eee8840-c268-4cf1-8f86-a0d13eaf9b16.json deleted file mode 100644 index bbb9b46..0000000 --- a/server/resources/db_info/5eee8840-c268-4cf1-8f86-a0d13eaf9b16.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "database_id": "5eee8840-c268-4cf1-8f86-a0d13eaf9b16", - "database_name": "test-db-3", - "db_type": "mysql", - "tables": [ - { - "id": "2a52c3a0-0019-4634-a4b3-3627a02153ba", - "database_id": "5eee8840-c268-4cf1-8f86-a0d13eaf9b16", - "parent_table": "database_info", - "sub_table_name": "DB��Ϣ", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "ddl": "CREATE TABLE `database_info` (\n`id` varchar(36) NOT NULL, COMMENT 'ID'\n`name` varchar(100) NOT NULL, COMMENT '����'\n `description` varchar(500) DEFAULT NULL,\n `db_type` varchar(20) NOT NULL,\n`host` varchar(255) NOT NULL, COMMENT '������ַ'\n `port` bigint NOT NULL,\n `username` varchar(100) NOT NULL,\n `password` varchar(255) DEFAULT NULL,\n `database` varchar(100) DEFAULT NULL,\n `table_count` bigint DEFAULT '0',\n `charset` varchar(20) DEFAULT 'utf8mb4',\n `ssl_mode` varchar(20) DEFAULT NULL,\n `created_at` datetime(3) DEFAULT NULL,\n `updated_at` datetime(3) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", - "created_at": "2026-03-06T15:57:24.011+08:00", - "updated_at": "2026-03-06T15:57:24.011+08:00" - } - ], - "updated_at": "2026-03-06T15:57:24.0628515+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/68b6fb60-eae2-495b-b248-9c46c8d8d6cb.json b/server/resources/db_info/68b6fb60-eae2-495b-b248-9c46c8d8d6cb.json deleted file mode 100644 index 76830f7..0000000 --- a/server/resources/db_info/68b6fb60-eae2-495b-b248-9c46c8d8d6cb.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "database_id": "68b6fb60-eae2-495b-b248-9c46c8d8d6cb", - "database_name": "test-db-4", - "db_type": "mysql", - "tables": [ - { - "id": "5107d64f-9949-4550-9030-e7e14585f080", - "database_id": "68b6fb60-eae2-495b-b248-9c46c8d8d6cb", - "parent_table": "database_info", - "sub_table_name": "DB��", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "ddl": "CREATE TABLE `database_info` (\n`id` varchar(36) NOT NULL COMMENT '����ID'\n`name` varchar(100) NOT NULL COMMENT '���ݿ���'\n `description` varchar(500) DEFAULT NULL,\n `db_type` varchar(20) NOT NULL,\n`host` varchar(255) NOT NULL COMMENT '������'\n `port` bigint NOT NULL,\n `username` varchar(100) NOT NULL,\n `password` varchar(255) DEFAULT NULL,\n `database` varchar(100) DEFAULT NULL,\n `table_count` bigint DEFAULT '0',\n `charset` varchar(20) DEFAULT 'utf8mb4',\n `ssl_mode` varchar(20) DEFAULT NULL,\n `created_at` datetime(3) DEFAULT NULL,\n `updated_at` datetime(3) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", - "created_at": "2026-03-06T16:00:34.065+08:00", - "updated_at": "2026-03-06T16:00:34.065+08:00" - } - ], - "updated_at": "2026-03-06T16:00:34.1176551+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/7eb66808-db8b-428e-8548-2f754c4fc688.json b/server/resources/db_info/7eb66808-db8b-428e-8548-2f754c4fc688.json deleted file mode 100644 index 2ca37df..0000000 --- a/server/resources/db_info/7eb66808-db8b-428e-8548-2f754c4fc688.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "database_id": "7eb66808-db8b-428e-8548-2f754c4fc688", - "database_name": "123", - "db_type": "mysql", - "tables": [ - { - "id": "66026752-77b6-4cba-a4d1-1bf3b07e920c", - "database_id": "7eb66808-db8b-428e-8548-2f754c4fc688", - "parent_table": "teachers", - "sub_table_name": "teachers", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "created_at": "2026-03-06T15:12:24.217+08:00", - "updated_at": "2026-03-06T15:12:24.217+08:00" - }, - { - "id": "be59cb63-c5cf-46bf-b77a-46ce1fcb374b", - "database_id": "7eb66808-db8b-428e-8548-2f754c4fc688", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "created_at": "2026-03-06T15:12:24.112+08:00", - "updated_at": "2026-03-06T15:12:24.112+08:00" - }, - { - "id": "d91e5cd4-09c9-40a8-9c42-8f5ce0f059e1", - "database_id": "7eb66808-db8b-428e-8548-2f754c4fc688", - "parent_table": "students", - "sub_table_name": "students", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "created_at": "2026-03-06T15:12:24.166+08:00", - "updated_at": "2026-03-06T15:12:24.166+08:00" - } - ], - "updated_at": "2026-03-06T15:12:24.2696469+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/96d39e69-c96b-4d22-9b29-6456de71c6c1.json b/server/resources/db_info/96d39e69-c96b-4d22-9b29-6456de71c6c1.json deleted file mode 100644 index 2abe2df..0000000 --- a/server/resources/db_info/96d39e69-c96b-4d22-9b29-6456de71c6c1.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "database_id": "96d39e69-c96b-4d22-9b29-6456de71c6c1", - "database_name": "189数据库", - "db_type": "mysql", - "tables": [ - { - "id": "d56ef61e-ac0d-439d-a2e8-133d766cbdd9", - "database_id": "96d39e69-c96b-4d22-9b29-6456de71c6c1", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "ddl": "CREATE TABLE `scores` (\n`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '分数id'\n `student_id` int(10) unsigned NOT NULL,\n `subject` varchar(50) NOT NULL COMMENT '科目',\n `score` double DEFAULT NULL COMMENT '分数',\n `teacher_id` int(10) unsigned DEFAULT NULL,\n `exam_date` date DEFAULT NULL COMMENT '考试日期',\n `created_at` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4", - "created_at": "2026-03-06T16:07:17.146+08:00", - "updated_at": "2026-03-06T16:07:17.146+08:00" - } - ], - "updated_at": "2026-03-06T16:07:17.1980788+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/a58e6c1e-b39b-4248-8de9-b172f134197b.json b/server/resources/db_info/a58e6c1e-b39b-4248-8de9-b172f134197b.json deleted file mode 100644 index 77ac71f..0000000 --- a/server/resources/db_info/a58e6c1e-b39b-4248-8de9-b172f134197b.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "database_id": "a58e6c1e-b39b-4248-8de9-b172f134197b", - "database_name": "test-db-2", - "db_type": "mysql", - "tables": [ - { - "id": "613c5bb7-2d42-4b75-8f19-43a2b345de8b", - "database_id": "a58e6c1e-b39b-4248-8de9-b172f134197b", - "parent_table": "database_info", - "sub_table_name": "���ݿ���Ϣ��", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "ddl": "CREATE TABLE `database_info` (\n `id` varchar(36) NOT NULL,\n `name` varchar(100) NOT NULL,\n `description` varchar(500) DEFAULT NULL,\n `db_type` varchar(20) NOT NULL,\n `host` varchar(255) NOT NULL,\n `port` bigint NOT NULL,\n `username` varchar(100) NOT NULL,\n `password` varchar(255) DEFAULT NULL,\n `database` varchar(100) DEFAULT NULL,\n `table_count` bigint DEFAULT '0',\n `charset` varchar(20) DEFAULT 'utf8mb4',\n `ssl_mode` varchar(20) DEFAULT NULL,\n `created_at` datetime(3) DEFAULT NULL,\n `updated_at` datetime(3) DEFAULT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci", - "created_at": "2026-03-06T15:51:28.706+08:00", - "updated_at": "2026-03-06T15:51:28.706+08:00" - } - ], - "updated_at": "2026-03-06T15:51:28.762063+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/a89dfc3e-5089-4a9e-8f6b-991d5bebd85d.json b/server/resources/db_info/a89dfc3e-5089-4a9e-8f6b-991d5bebd85d.json deleted file mode 100644 index f79f368..0000000 --- a/server/resources/db_info/a89dfc3e-5089-4a9e-8f6b-991d5bebd85d.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "database_id": "a89dfc3e-5089-4a9e-8f6b-991d5bebd85d", - "database_name": "1231", - "db_type": "mysql", - "tables": [ - { - "id": "0fbec3c2-ab05-4288-a797-bdf03eec9f2b", - "database_id": "a89dfc3e-5089-4a9e-8f6b-991d5bebd85d", - "parent_table": "students", - "sub_table_name": "students", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "fields": null, - "ddl": "CREATE TABLE `students` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(50) NOT NULL COMMENT '学生姓名',\n `age` int(11) DEFAULT NULL COMMENT '年龄',\n `gender` varchar(10) DEFAULT NULL COMMENT '性别',\n `class` varchar(50) DEFAULT NULL COMMENT '班级',\n `phone` varchar(20) DEFAULT NULL COMMENT '电话',\n `created_at` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4", - "created_at": "2026-03-07T10:44:27.61+08:00", - "updated_at": "2026-03-07T10:44:27.61+08:00" - }, - { - "id": "693944e2-d610-4a09-aee9-1af0c8246fb4", - "database_id": "a89dfc3e-5089-4a9e-8f6b-991d5bebd85d", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "fields": null, - "ddl": "CREATE TABLE `scores` (\n `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `student_id` int(10) unsigned NOT NULL,\n `subject` varchar(50) NOT NULL COMMENT '科目',\n `score` double DEFAULT NULL COMMENT '分数',\n `teacher_id` int(10) unsigned DEFAULT NULL,\n `exam_date` date DEFAULT NULL COMMENT '考试日期',\n `created_at` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4", - "created_at": "2026-03-07T10:44:27.56+08:00", - "updated_at": "2026-03-07T10:44:27.56+08:00" - } - ], - "updated_at": "2026-03-07T10:44:27.6628932+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/b5fc80da-b681-4f6f-a35a-73e73dee50d0.json b/server/resources/db_info/b5fc80da-b681-4f6f-a35a-73e73dee50d0.json deleted file mode 100644 index 4b6d667..0000000 --- a/server/resources/db_info/b5fc80da-b681-4f6f-a35a-73e73dee50d0.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "database_id": "b5fc80da-b681-4f6f-a35a-73e73dee50d0", - "database_name": "123", - "db_type": "mysql", - "tables": [ - { - "id": "49805b02-3204-44b9-9d28-3b5053ca7a1e", - "database_id": "b5fc80da-b681-4f6f-a35a-73e73dee50d0", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "created_at": "2026-03-06T15:12:36.292+08:00", - "updated_at": "2026-03-06T15:12:36.292+08:00" - } - ], - "updated_at": "2026-03-06T15:12:36.3469958+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/d022a68d-cb75-405b-bee3-e923a8b5a283.json b/server/resources/db_info/d022a68d-cb75-405b-bee3-e923a8b5a283.json deleted file mode 100644 index 764535a..0000000 --- a/server/resources/db_info/d022a68d-cb75-405b-bee3-e923a8b5a283.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "database_id": "d022a68d-cb75-405b-bee3-e923a8b5a283", - "database_name": "123", - "db_type": "mysql", - "tables": [], - "updated_at": "2026-03-06T15:32:13.1521688+08:00" -} \ No newline at end of file diff --git a/server/resources/db_info/d44fa121-5964-439f-8c5d-0384ba27b411.json b/server/resources/db_info/d44fa121-5964-439f-8c5d-0384ba27b411.json deleted file mode 100644 index 532c81d..0000000 --- a/server/resources/db_info/d44fa121-5964-439f-8c5d-0384ba27b411.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "database_id": "d44fa121-5964-439f-8c5d-0384ba27b411", - "database_name": "123", - "db_type": "mysql", - "tables": [ - { - "id": "694da06f-d6b7-4915-8502-c4c38addf059", - "database_id": "d44fa121-5964-439f-8c5d-0384ba27b411", - "parent_table": "scores", - "sub_table_name": "scores", - "sub_table_comment": "", - "mapping_type": "", - "relation_field": "", - "relation_type": "", - "fields": null, - "ddl": "CREATE TABLE `scores` (\n`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'fenshu id'\n `student_id` int(10) unsigned NOT NULL,\n `subject` varchar(50) NOT NULL COMMENT '科目',\n `score` double DEFAULT NULL COMMENT '分数',\n `teacher_id` int(10) unsigned DEFAULT NULL,\n `exam_date` date DEFAULT NULL COMMENT '考试日期',\n `created_at` datetime DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb4", - "created_at": "2026-03-06T16:30:41.589+08:00", - "updated_at": "2026-03-06T16:30:41.589+08:00" - } - ], - "updated_at": "2026-03-06T16:30:41.639042+08:00" -} \ No newline at end of file diff --git a/team-require/api/upload-api.md b/team-require/api/upload-api.md new file mode 100644 index 0000000..b452c58 --- /dev/null +++ b/team-require/api/upload-api.md @@ -0,0 +1,96 @@ +# 文件上传 API + +## 基础信息 + +| 项目 | 说明 | +|------|------| +| 基础URL | `http://localhost:8082` | +| 上传模式 | local / minio(配置决定) | + +## 配置说明 + +```yaml +# config.yaml +upload_mode: "local" # 上传模式:local 或 minio +upload_local_path: "resource/files" # 本地存储路径 +server_base_url: "http://localhost:8082" # 服务器基础URL + +# MinIO 配置(upload_mode 为 minio 时需要) +minio_endpoint: "localhost:9000" +minio_access_key: "your-access-key" +minio_secret_key: "your-secret-key" +minio_bucket: "x-agents" +minio_use_ssl: false +``` + +## 接口列表 + +### 1. 上传文件 + +**请求** + +``` +POST /upload +Content-Type: multipart/form-data +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| file | File | 是 | 要上传的文件 | + +**响应** + +```json +{ + "success": true, + "url": "http://localhost:8082/files/abc123.pdf", + "fileKey": "abc123", + "message": "Upload successful" +} +``` + +**错误响应** + +```json +{ + "success": false, + "message": "File too large (max 100MB)" +} +``` + +--- + +### 2. 删除文件 + +**请求** + +``` +DELETE /upload/:filename +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| filename | String | 是 | 文件名(不含路径) | + +**响应** + +```json +{ + "success": true, + "message": "File deleted" +} +``` + +--- + +### 3. 访问文件(仅本地模式) + +文件上传后,本地模式下可通过以下 URL 直接访问: + +``` +GET /files/{filename} +``` + +例如:`http://localhost:8082/files/abc123.pdf` + +> 注意:MinIO 模式返回的是预签名 URL,有效期 24 小时。 diff --git a/team-require/web/knowledge-base-api.md b/team-require/web/knowledge-base-api.md new file mode 100644 index 0000000..ec6d4a1 --- /dev/null +++ b/team-require/web/knowledge-base-api.md @@ -0,0 +1,354 @@ +# 知识库创建 API + +## 基础信息 + +| 项目 | 说明 | +|------|------| +| 基础URL | `http://localhost:8082` | +| 前端页面 | Knowledge Base 创建弹窗 | + +## 接口列表 + +### 1. 创建知识库 + +**请求** + +``` +POST /api/knowledge/create +Content-Type: application/json +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| name | String | 是 | 知识库名称 | +| description | String | 否 | 知识库描述 | +| llm_model_id | String | 是 | LLM 模型 ID(来自 model 表) | +| embedding_model_id | String | 是 | Embedding 模型 ID(来自 model 表) | +| parsing_config | Object | 是 | 解析配置 | +| - engine | String | 是 | 解析引擎:markitdown / docling | +| - docling_url | String | 条件必填 | Docling 服务 URL(engine=docling 时必填) | +| - enable_pdf | Boolean | 否 | 是否启用 PDF 解析(默认 true) | +| - pandoc | Boolean | 否 | 是否启用 Pandoc(默认 true) | + +**请求示例** + +```json +{ + "name": "产品文档知识库", + "description": "用于存储产品手册和文档", + "llm_model_id": "model_001", + "embedding_model_id": "model_002", + "parsing_config": { + "engine": "markitdown", + "enable_pdf": true, + "pandoc": true + } +} +``` + +或使用 Docling: + +```json +{ + "name": "产品文档知识库", + "description": "用于存储产品手册和文档", + "llm_model_id": "model_001", + "embedding_model_id": "model_002", + "parsing_config": { + "engine": "docling", + "docling_url": "http://localhost:8501", + "enable_pdf": true, + "pandoc": true + } +} +``` + +**成功响应** + +```json +{ + "success": true, + "id": "kb_abc123", + "message": "Knowledge base created successfully" +} +``` + +**错误响应** + +```json +{ + "success": false, + "message": "LLM model not found" +} +``` + +--- + +### 2. 获取知识库列表 + +**请求** + +``` +GET /api/knowledge/list +``` + +**响应** + +```json +{ + "success": true, + "data": [ + { + "id": "kb_001", + "name": "产品文档知识库", + "description": "用于存储产品手册", + "llm_model_id": "model_001", + "embedding_model_id": "model_002", + "status": "active", + "document_count": 15, + "chunk_count": 156, + "created_at": "2024-01-15T10:30:00Z", + "updated_at": "2024-01-15T10:30:00Z" + } + ] +} +``` + +--- + +### 3. 获取知识库详情 + +**请求** + +``` +GET /api/knowledge/:id +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| id | String | 是 | 知识库 ID | + +**响应** + +```json +{ + "success": true, + "data": { + "id": "kb_001", + "name": "产品文档知识库", + "description": "用于存储产品手册", + "llm_model_id": "model_001", + "embedding_model_id": "model_002", + "parsing_config": { + "engine": "markitdown", + "enable_pdf": true, + "pandoc": true + }, + "status": "active", + "document_count": 15, + "chunk_count": 156, + "created_at": "2024-01-15T10:30:00Z", + "updated_at": "2024-01-15T10:30:00Z" + } +} +``` + +--- + +### 4. 删除知识库 + +**请求** + +``` +DELETE /api/knowledge/:id +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| id | String | 是 | 知识库 ID | + +**响应** + +```json +{ + "success": true, + "message": "Knowledge base deleted" +} +``` + +--- + +### 5. 获取知识库下的文档列表 + +**请求** + +``` +GET /api/knowledge/:id/documents +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| id | String | 是 | 知识库 ID | + +**查询参数** + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| status | String | 否 | 过滤状态:all / parsed / parsing / failed | + +**响应** + +```json +{ + "success": true, + "data": [ + { + "id": "doc_001", + "name": "产品手册_v2.0.pdf", + "file_size": 2516582, + "status": "parsed", + "chunk_count": 156, + "uploaded_at": "2024-01-15T10:30:00Z" + } + ] +} +``` + +--- + +### 6. 上传文档到知识库 + +**请求** + +``` +POST /api/knowledge/:id/documents +Content-Type: multipart/form-data +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| id | String | 是 | 知识库 ID | +| file | File | 是 | 要上传的文件 | + +**响应** + +```json +{ + "success": true, + "dataid": "doc_001", + ": { + " "name": "产品手册_v2.0.pdf", + "status": "parsing" + } +} +``` + +--- + +### 7. 删除知识库文档 + +**请求** + +``` +DELETE /api/knowledge/:id/documents/:doc_id +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| id | String | 是 | 知识库 ID | +| doc_id | String | 是 | 文档 ID | + +**响应** + +```json +{ + "success": true, + "message": "Document deleted" +} +``` + +--- + +### 8. 重新解析文档 + +**请求** + +``` +POST /api/knowledge/:id/documents/:doc_id/reparse +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| id | String | 是 | 知识库 ID | +| doc_id | String | 是 | 文档 ID | + +**响应** + +```json +{ + "success": true, + "message": "Document reparse started" +} +``` + +--- + +### 9. 获取文档预览内容 + +**请求** + +``` +GET /api/knowledge/:id/documents/:doc_id/preview +``` + +| 参数 | 类型 | 必填 | 说明 | +|------|------|------|------| +| id | String | 是 | 知识库 ID | +| doc_id | String | 是 | 文档 ID | +| page | Number | 否 | 页码(默认 1) | + +**响应** + +```json +{ + "success": true, + "data": { + "total_pages": 3, + "current_page": 1, + "content": "第一章 产品介绍\n\n欢迎使用我们的产品手册..." + } +} +``` + +--- + +## 数据库表设计(参考) + +### knowledge_base 表 + +| 字段 | 类型 | 说明 | +|------|------|------| +| id | String | 主键 | +| name | String | 知识库名称 | +| description | Text | 描述 | +| llm_model_id | String | LLM 模型 ID | +| embedding_model_id | String | Embedding 模型 ID | +| parsing_config | JSON | 解析配置 | +| status | String | 状态:active / inactive | +| document_count | Integer | 文档数量 | +| chunk_count | Integer | 切片数量 | +| created_at | Timestamp | 创建时间 | +| updated_at | Timestamp | 更新时间 | + +### knowledge_document 表 + +| 字段 | 类型 | 说明 | +|------|------|------| +| id | String | 主键 | +| knowledge_base_id | String | 知识库 ID | +| name | String | 文档名称 | +| file_key | String | 文件存储 key | +| file_size | BigInteger | 文件大小 | +| status | String | 状态:parsing / parsed / failed | +| chunk_count | Integer | 切片数量 | +| uploaded_at | Timestamp | 上传时间 | diff --git a/team-require/web/todo-2026-3-7.md b/team-require/web/todo-2026-3-8.md similarity index 75% rename from team-require/web/todo-2026-3-7.md rename to team-require/web/todo-2026-3-8.md index 69eb2b9..9e275f3 100644 --- a/team-require/web/todo-2026-3-7.md +++ b/team-require/web/todo-2026-3-8.md @@ -2,6 +2,16 @@ ## 2026年3月 +### 2026-03-08 + +- [ ] **知识库(Knowledge Base)API** - 后端待实现 + - 创建知识库、获取列表、获取详情、删除 + - 上传文档、删除文档、重新解析 + - 获取文档预览内容 + - 详细需求:[knowledge-base-api.md](./knowledge-base-api.md) + +--- + ### 2026-03-07 - [x] **DDL 编辑功能** - 后端已完成 ✔