- 新增 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>
40 lines
1.6 KiB
Go
40 lines
1.6 KiB
Go
package model
|
||
|
||
// Neo4jCheckRequest Neo4j 连接测试请求
|
||
type Neo4jCheckRequest struct {
|
||
Name string `json:"name"` // 数据库名称
|
||
Host string `json:"host" binding:"required"`
|
||
Port int `json:"port" binding:"required"`
|
||
Username string `json:"username" binding:"required"`
|
||
Password string `json:"password" binding:"required"`
|
||
Database string `json:"database"` // 可选,默认 neo4j
|
||
URI string `json:"uri"` // 可选,Neo4j 连接地址 (bolt://host:7687)
|
||
Description string `json:"description"` // 可选,数据库描述
|
||
}
|
||
|
||
// Neo4jCheckResponse Neo4j 连接测试响应
|
||
type Neo4jCheckResponse struct {
|
||
Success bool `json:"success"`
|
||
Message string `json:"message"`
|
||
Version string `json:"version,omitempty"`
|
||
Databases []string `json:"databases,omitempty"`
|
||
DatabaseID string `json:"databaseId,omitempty"` // 数据库记录 ID
|
||
Name string `json:"name,omitempty"` // 数据库名称
|
||
Description string `json:"description,omitempty"` // 数据库描述
|
||
}
|
||
|
||
// Neo4jGraphRequest 获取图谱概览请求
|
||
type Neo4jGraphRequest struct {
|
||
URI string `json:"uri" binding:"required"`
|
||
Username string `json:"username" binding:"required"`
|
||
Password string `json:"password" binding:"required"`
|
||
Database string `json:"database"` // 可选,默认 neo4j
|
||
}
|
||
|
||
// Neo4jGraphResponse 获取图谱概览响应
|
||
type Neo4jGraphResponse struct {
|
||
Success bool `json:"success"`
|
||
Message string `json:"message"`
|
||
Graphs *GraphOverview `json:"graphs,omitempty"`
|
||
}
|