feat: 添加Neo4j图数据库支持及前端代码重构

- 新增 Neo4j 图数据库 handler、service、model
- 后端添加 SaveGraph API 接口
- 前端 Database.vue 重构,拆分为独立组件
- 新增 web/src/views/database/ 组件目录
- 删除临时文件 (temp_*.go)
- 添加 Neo4j 相关 API 需求文档

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 09:11:08 +08:00
parent 20015dbd2a
commit c917d6b04c
41 changed files with 4453 additions and 1021 deletions

View File

@@ -79,10 +79,12 @@ func main() {
// 5. 初始化 Service
dbService := service.NewDatabaseService(dbRepo, subTableRepo)
subTableService := service.NewSubTableService(subTableRepo, dbRepo)
neo4jService := service.NewNeo4jService(dbRepo)
// 6. 初始化 Handler
dbHandler := handler.NewDatabaseHandler(dbService)
subTableHandler := handler.NewSubTableHandler(subTableService)
neo4jHandler := handler.NewNeo4jHandler(neo4jService)
systemHandler := handler.NewSystemHandler()
// 7. 设置路由
@@ -137,6 +139,7 @@ func main() {
databaseGroup.POST("/add", dbHandler.Create)
databaseGroup.PUT("/:id", dbHandler.Update)
databaseGroup.DELETE("/:id", dbHandler.Delete)
databaseGroup.POST("/graph/save", dbHandler.SaveGraph)
}
// 子表映射管理模块
@@ -151,6 +154,15 @@ func main() {
subTableGroup.DELETE("/:id", subTableHandler.Delete)
}
// Neo4j 连接管理模块
neo4jGroup := r.Group("/neo4j")
{
neo4jGroup.POST("/check", neo4jHandler.Check)
neo4jGroup.POST("/graphs", neo4jHandler.GetGraphs)
neo4jGroup.POST("/nodes", neo4jHandler.GetNodes)
neo4jGroup.POST("/relationships", neo4jHandler.GetRelationships)
}
// 系统信息模块
r.GET("/system/info", systemHandler.GetSystemInfo)