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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user