Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/17796

Daniel4437737f95ab
diff --git a/kernel/api/block.go b/kernel/api/block.go
index 07e8a26531..84f9bbda95 100644
--- a/kernel/api/block.go
+++ b/kernel/api/block.go
@@ -300,7 +300,11 @@ func setBlockReminder(c *gin.Context) {
id := arg["id"].(string)
timed := arg["timed"].(string) // yyyyMMddHHmmss
- err := model.SetBlockReminder(id, timed)
+ var content string
+ if nil != arg["content"] {
+ content = arg["content"].(string)
+ }
+ err := model.SetBlockReminder(id, content, timed)
if err != nil {
ret.Code = -1
ret.Msg = err.Error()
diff --git a/kernel/model/blockial.go b/kernel/model/blockial.go
index 44a06e351f..cd069de79d 100644
--- a/kernel/model/blockial.go
+++ b/kernel/model/blockial.go
@@ -35,7 +35,7 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
-func SetBlockReminder(id string, timed string) (err error) {
+func SetBlockReminder(id, customContent, timed string) (err error) {
if !IsSubscriber() {
if "ios" == util.Container {
return errors.New(Conf.Language(122))
@@ -68,9 +68,16 @@ func SetBlockReminder(id string, timed string) (err error) {
if ast.NodeDocument != node.Type && node.IsContainerBlock() {
node = treenode.FirstLeafBlock(node)
}
- content := sql.NodeStaticContent(node, nil, false, false, false)
- content = gulu.Str.SubStr(content, 128)
- content = strings.ReplaceAll(content, editor.Zwsp, "")
+
+ var content string
+ customContent = strings.TrimSpace(customContent)
+ if "" == customContent {
+ content = sql.NodeStaticContent(node, nil, false, false, false)
+ content = gulu.Str.SubStr(content, 128)
+ content = strings.ReplaceAll(content, editor.Zwsp, "")
+ } else {
+ content = customContent
+ }
err = SetCloudBlockReminder(id, content, timedMills)
if err != nil {
return