feat: Add callback and exchange features, refactor care plan task generation logic, and update wiki ordering to prioritize hot items.

This commit is contained in:
Blizzard
2026-02-26 08:57:13 +08:00
parent 9d4a5c6375
commit 3f05dccdce
23 changed files with 955 additions and 56 deletions
+7 -4
View File
@@ -47,7 +47,10 @@ func SendCareMsg() error {
// 将tasks分组,key为用户id 保证无论用户有多少植物,只给用户发送一条消息
tasksMap := make(map[string][]*plant.CareTask)
for _, task := range tasks {
tasksMap[task.UserId] = append(tasksMap[task.UserId], task)
//用户id不为空再添加
if task.UserId != "" {
tasksMap[task.UserId] = append(tasksMap[task.UserId], task)
}
}
for userId, cares := range tasksMap {
//1.查询用户
@@ -78,9 +81,9 @@ func SendCareMsg() error {
Value: time.Date(now.Year(), now.Month(), now.Day(), 8, 30, 0, 0, time.Local).Format("2006-01-02"),
},
},
//MiniProgramState: "formal",
MiniProgramState: "trial",
Lang: "zh_CN",
MiniProgramState: "formal",
//MiniProgramState: "trial",
Lang: "zh_CN",
}
payloadBytes, err := json.Marshal(payload)
if err != nil {