feat(knowledge): index note relationships and maintain moved links
This commit is contained in:
1 parent
d34d1f2183
commit
a923c2dfb9
19 files changed
+545
-79
No files matched your search
@@ -76,6 +76,7 @@ func (s *Server) routes() []route {
|
||||
{"POST /api/v1/auth/password", sessionOnly, s.changePassword},
|
||||
|
||||
{"GET /api/v1/tree", authed, s.tree},
|
||||
{"GET /api/v1/metadata", authed, s.metadata},
|
||||
{"POST /api/v1/export", authed, s.export},
|
||||
{"GET /api/v1/files/{path...}", authed, s.readFile},
|
||||
{"PUT /api/v1/files/{path...}", authed, s.writeFile},
|
||||
@@ -522,3 +523,12 @@ func vaultError(w http.ResponseWriter, r *http.Request, err error) {
|
||||
internalError(w, r, err)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) metadata(w http.ResponseWriter, r *http.Request) {
|
||||
notes, ready, err := s.index.Metadata()
|
||||
if err != nil {
|
||||
internalError(w, r, err)
|
||||
return
|
||||
}
|
||||
writeJSON(w, 200, map[string]any{"notes": notes, "ready": ready})
|
||||
}
|
||||
@@ -2431,6 +2431,24 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/metadata": {
|
||||
"get": {
|
||||
"summary": "读取笔记关系、标签与资源引用索引",
|
||||
"security": [
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"bearer": []
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "索引就绪状态与元数据列表,不含笔记正文"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
|
||||
Reference in new issue
Block a user