Commit 124d8383 authored by hujiebin's avatar hujiebin

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

parents 9a2d6769 174ccbdd
package cp_cron package cp_cron
import ( import (
"encoding/json" "git.hilo.cn/hilo-common/_const/enum/msg_e"
"git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/config" "git.hilo.cn/hilo-common/resource/config"
"github.com/robfig/cron" "github.com/robfig/cron"
"hilo-user/domain/model/cp_m" "hilo-user/domain/model/cp_m"
"hilo-user/domain/model/user_m" "hilo-user/domain/model/msg_m"
) )
// 纪念日 // 纪念日
...@@ -30,17 +30,13 @@ func CpAnniversaryNotice() { ...@@ -30,17 +30,13 @@ func CpAnniversaryNotice() {
for _, v := range anniversary { for _, v := range anniversary {
var userIds []uint64 var userIds []uint64
userIds = append(userIds, v.UserId1, v.UserId2) userIds = append(userIds, v.UserId1, v.UserId2)
users, err := user_m.GetUsersByIds(model, userIds) record1 := msg_m.NewUserRecord(model, v.UserId1, msg_e.CpAnniversaryNotice, v.Content, 0, "", "", "", "", "")
if err != nil || len(users) < 2 { record2 := msg_m.NewUserRecord(model, v.UserId2, msg_e.CpAnniversaryNotice, v.Content, 0, "", "", "", "", "")
model.Log.Errorf("GetUserMapByIds fail:%v", err) err1, err2 := record1.Persistent(), record2.Persistent()
continue 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 { //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) // 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