Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve content stat https://github.com/siyuan-note/siyuan/issues/13627

Danielf2584745f55d
diff --git a/kernel/api/block.go b/kernel/api/block.go
index 7c42e3e2c9..2b69ef0696 100644
--- a/kernel/api/block.go
+++ b/kernel/api/block.go
@@ -337,7 +337,10 @@ func getContentWordCount(c *gin.Context) {
}
content := arg["content"].(string)
- ret.Data = filesys.ContentStat(content)
+ ret.Data = map[string]any{
+ "reqId": arg["reqId"],
+ "stat": filesys.ContentStat(content),
+ }
}
func getBlocksWordCount(c *gin.Context) {
@@ -354,7 +357,10 @@ func getBlocksWordCount(c *gin.Context) {
for _, id := range idsArg {
ids = append(ids, id.(string))
}
- ret.Data = filesys.BlocksWordCount(ids)
+ ret.Data = map[string]any{
+ "reqId": arg["reqId"],
+ "stat": filesys.BlocksWordCount(ids),
+ }
}
func getTreeStat(c *gin.Context) {
@@ -367,7 +373,10 @@ func getTreeStat(c *gin.Context) {
}
id := arg["id"].(string)
- ret.Data = filesys.StatTree(id)
+ ret.Data = map[string]any{
+ "reqId": arg["reqId"],
+ "stat": filesys.StatTree(id),
+ }
}
func getDOMText(c *gin.Context) {