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:
75
team-require/api/neo4j-graph-save.md
Normal file
75
team-require/api/neo4j-graph-save.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# Neo4j 图谱保存接口需求
|
||||
|
||||
## 需求说明
|
||||
|
||||
前端需要保存 Neo4j 图谱的连接信息,以便后续快速加载和查看。
|
||||
|
||||
---
|
||||
|
||||
## 接口地址
|
||||
|
||||
```
|
||||
POST /database/graph/save
|
||||
```
|
||||
|
||||
## 请求参数
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| databaseId | string | 是 | 数据库 ID |
|
||||
| databaseName | string | 是 | 数据库名称 |
|
||||
| uri | string | 是 | Neo4j 连接地址,如 bolt://localhost:7687 |
|
||||
| username | string | 是 | 用户名 |
|
||||
| labels | array | 是 | 标签列表 |
|
||||
| relationshipTypes | array | 是 | 关系类型列表 |
|
||||
| selectedLabel | string | 否 | 当前选中的标签 |
|
||||
|
||||
## 请求示例
|
||||
|
||||
```json
|
||||
{
|
||||
"databaseId": "123",
|
||||
"databaseName": "neo4j",
|
||||
"uri": "bolt://10.10.10.189:7687",
|
||||
"username": "neo4j",
|
||||
"labels": ["User", "Order", "Product"],
|
||||
"relationshipTypes": ["KNOWS", "BOUGHT", "BELONGS_TO"],
|
||||
"selectedLabel": "User"
|
||||
}
|
||||
```
|
||||
|
||||
## 返回参数
|
||||
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| success | bool | 是否成功 |
|
||||
| message | string | 消息 |
|
||||
|
||||
## 返回示例
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "保存成功"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 前端调用示例
|
||||
|
||||
```javascript
|
||||
fetch('/database/graph/save', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
databaseId: '123',
|
||||
databaseName: 'neo4j',
|
||||
uri: 'bolt://10.10.10.189:7687',
|
||||
username: 'neo4j',
|
||||
labels: ['User', 'Order', 'Product'],
|
||||
relationshipTypes: ['KNOWS', 'BOUGHT', 'BELONGS_TO'],
|
||||
selectedLabel: 'User',
|
||||
}),
|
||||
})
|
||||
```
|
||||
Reference in New Issue
Block a user