feat: 重构前后端架构,添加Go后端和Python Agent服务

- 新增 Go 语言后端服务(server/),包含用户认证、Agent管理、数据库连接等API
- 新增 Python Agent 服务(agent/),实现Agent核心逻辑和工具集
- 前端从原生HTML迁移到Vue.js框架(web/src/)
- 添加 Docker Compose 支持(docker-compose.yml)
- 添加项目架构文档(docs/ARCHITECTURE.md)
- 添加环境变量示例(.env.example)和本地启动脚本(start-local.ps1)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 16:39:42 +08:00
parent 6fe3c412f4
commit b2bc9988a9
90 changed files with 9317 additions and 469 deletions

View File

@@ -0,0 +1,7 @@
{
"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"
}

View File

@@ -0,0 +1,22 @@
{
"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"
}

View File

@@ -0,0 +1,20 @@
{
"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"
}

View File

@@ -0,0 +1,22 @@
{
"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"
}

View File

@@ -0,0 +1,21 @@
{
"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<44><42>Ϣ",
"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 '<27><><EFBFBD><EFBFBD>'\n `description` varchar(500) DEFAULT NULL,\n `db_type` varchar(20) NOT NULL,\n`host` varchar(255) NOT NULL, COMMENT '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ'\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"
}

View File

@@ -0,0 +1,21 @@
{
"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<44><42>",
"sub_table_comment": "",
"mapping_type": "",
"relation_field": "",
"relation_type": "",
"ddl": "CREATE TABLE `database_info` (\n`id` varchar(36) NOT NULL COMMENT '<27><><EFBFBD><EFBFBD>ID'\n`name` varchar(100) NOT NULL COMMENT '<27><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD>'\n `description` varchar(500) DEFAULT NULL,\n `db_type` varchar(20) NOT NULL,\n`host` varchar(255) NOT NULL COMMENT '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'\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"
}

View File

@@ -0,0 +1,44 @@
{
"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"
}

View File

@@ -0,0 +1,21 @@
{
"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"
}

View File

@@ -0,0 +1,21 @@
{
"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": "<22><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD>Ϣ<EFBFBD><CFA2>",
"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"
}

View File

@@ -0,0 +1,20 @@
{
"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"
}

View File

@@ -0,0 +1,7 @@
{
"database_id": "d022a68d-cb75-405b-bee3-e923a8b5a283",
"database_name": "123",
"db_type": "mysql",
"tables": [],
"updated_at": "2026-03-06T15:32:13.1521688+08:00"
}

View File

@@ -0,0 +1,22 @@
{
"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"
}