Commit 124d8383 authored by hujiebin's avatar hujiebin

Merge branch 'feature/cp-new' into feature/3.9.0

parents 9a2d6769 174ccbdd
package cp_cron
import (
"encoding/json"
"git.hilo.cn/hilo-common/_const/enum/msg_e"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/config"
"github.com/robfig/cron"
"hilo-user/domain/model/cp_m"
"hilo-user/domain/model/user_m"
"hilo-user/domain/model/msg_m"
)
// 纪念日
......@@ -30,17 +30,13 @@ func CpAnniversaryNotice() {
for _, v := range anniversary {
var userIds []uint64
userIds = append(userIds, v.UserId1, v.UserId2)
users, err := user_m.GetUsersByIds(model, userIds)
if err != nil || len(users) < 2 {
model.Log.Errorf("GetUserMapByIds fail:%v", err)
continue
record1 := msg_m.NewUserRecord(model, v.UserId1, msg_e.CpAnniversaryNotice, v.Content, 0, "", "", "", "", "")
record2 := msg_m.NewUserRecord(model, v.UserId2, msg_e.CpAnniversaryNotice, v.Content, 0, "", "", "", "", "")
err1, err2 := record1.Persistent(), record2.Persistent()
if err1 != nil || err2 != nil {
model.Log.Errorf("NewUserRecord fail:%v-%v", err1, err2)
return
}
data, _ := json.Marshal(CpAnniversaryNoticeMsg{
Identifier: "CpAnniversaryNotice",
Content: v.Content,
Timestamp: v.Timestamp,
})
println(data) // todo 小助手
//if err := tencentyun.BatchSendCustomMsg(model, 1, users[0].ExternalId, []string{users[1].ExternalId}, string(data), "cp纪念日"); err != nil {
// model.Log.Errorf("BatchSendCustomMsg fail:%v", err)
//}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment