Commit 4fb4b928 authored by hujiebin's avatar hujiebin

翻译o了

parent ed24d79a
......@@ -7,6 +7,7 @@ import (
"github.com/robfig/cron"
"hilo-user/domain/model/cp_m"
"hilo-user/domain/model/msg_m"
"hilo-user/domain/model/user_m"
)
// 纪念日
......@@ -27,11 +28,20 @@ func CpAnniversaryNotice() {
_ = c.AddFunc(spec, func() {
var model = domain.CreateModelNil()
anniversary := cp_m.GetNeedRemindCpAnniversary(model)
var userIds []uint64
for _, v := range anniversary {
var userIds []uint64
userIds = append(userIds, v.UserId1, v.UserId2)
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, "", "", "", "", "")
userIds = append(userIds, v.UserId1)
userIds = append(userIds, v.UserId2)
}
users, err := user_m.GetUserMapByIds(model, userIds)
if err != nil {
model.Log.Errorf("GetUserMapByIds fail:%v", err)
}
for _, v := range anniversary {
content1 := cp_m.GetTranslate(285, users[v.UserId1].Language)
content2 := cp_m.GetTranslate(285, users[v.UserId2].Language)
record1 := msg_m.NewUserRecord(model, v.UserId1, msg_e.CpAnniversaryNotice, content1, 0, "", "", "", "", "")
record2 := msg_m.NewUserRecord(model, v.UserId2, msg_e.CpAnniversaryNotice, content2, 0, "", "", "", "", "")
err1, err2 := record1.Persistent(), record2.Persistent()
if err1 != nil || err2 != nil {
model.Log.Errorf("NewUserRecord fail:%v-%v", err1, err2)
......
......@@ -294,7 +294,15 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N
model.Log.Errorf("")
return
}
if err := rpc.SendCpUpgrade(users[userId1].Nick, users[userId2].Nick, users[userId1].Avatar, users[userId2].Avatar, uint32(cpLevel.Level), "成为 todo"); err != nil {
levelMsgIdMap := map[cp_e.CpLevel]uint{
cp_e.CpLevel1: 252,
cp_e.CpLevel2: 253,
cp_e.CpLevel3: 254,
cp_e.CpLevel4: 255,
cp_e.CpLevel5: 256,
}
content := fmt.Sprintf(GetTranslate(286, users[userId1].Language), GetTranslate(levelMsgIdMap[cpLevel.Level], users[userId1].Language))
if err := rpc.SendCpUpgrade(users[userId1].Nick, users[userId2].Nick, users[userId1].Avatar, users[userId2].Avatar, uint32(cpLevel.Level), content); err != nil {
model.Log.Errorf("SendCpUpgrade 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