Commit 2d562c8f authored by chenweijian's avatar chenweijian

cp翻译

parent 20afbb54
...@@ -7,7 +7,7 @@ type CpCancelStatus mysql.Type ...@@ -7,7 +7,7 @@ type CpCancelStatus mysql.Type
const ( const (
//新用户 //新用户
CpRelationInviteDiamond = 18888 CpRelationInviteDiamond = 18888 // cwj----
//1.未接受2.已接受3.拒接导致退费4.过期导致退费 //1.未接受2.已接受3.拒接导致退费4.过期导致退费
CpInvite CpInviteStatus = 1 CpInvite CpInviteStatus = 1
......
...@@ -30,8 +30,7 @@ func CpInviteCancelInit() { ...@@ -30,8 +30,7 @@ func CpInviteCancelInit() {
defer utils.CheckGoPanic() defer utils.CheckGoPanic()
model := domain.CreateModelNil() model := domain.CreateModelNil()
// 获取超过24小时没被处理的cp邀请 // 获取超过24小时没被处理的cp邀请
//inviteList, err := cp_m.GetCpInviteByTime(model, time.Now().AddDate(0, 0, -1)) cwj---- inviteList, err := cp_m.GetCpInviteByTime(model, time.Now().AddDate(0, 0, -1))
inviteList, err := cp_m.GetCpInviteByTime(model, time.Now().Add(-time.Minute*10)) // cwj----
if err != nil { if err != nil {
model.Log.Errorf("CpInviteCancelInit err:%v", err) model.Log.Errorf("CpInviteCancelInit err:%v", err)
return return
...@@ -61,8 +60,7 @@ func CpInviteCancelInit() { ...@@ -61,8 +60,7 @@ func CpInviteCancelInit() {
} }
// 获取超过24小时没被处理的cp解除申请 // 获取超过24小时没被处理的cp解除申请
//cancelList, err := cp_m.GetCpCancelByTime(model, time.Now().AddDate(0, 0, -1)) cwj---- cancelList, err := cp_m.GetCpCancelByTime(model, time.Now().AddDate(0, 0, -1))
cancelList, err := cp_m.GetCpCancelByTime(model, time.Now().Add(-time.Minute*10)) // cwj----
if err != nil { if err != nil {
model.Log.Errorf("CpInviteCancelInit err:%v", err) model.Log.Errorf("CpInviteCancelInit err:%v", err)
return return
......
...@@ -2,6 +2,7 @@ package cp_s ...@@ -2,6 +2,7 @@ package cp_s
import ( import (
"encoding/json" "encoding/json"
"git.hilo.cn/hilo-common/_const/common"
"git.hilo.cn/hilo-common/_const/enum/diamond_e" "git.hilo.cn/hilo-common/_const/enum/diamond_e"
"git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext" "git.hilo.cn/hilo-common/mycontext"
...@@ -13,6 +14,7 @@ import ( ...@@ -13,6 +14,7 @@ import (
"hilo-user/domain/model/cp_m" "hilo-user/domain/model/cp_m"
"hilo-user/domain/model/diamond_m" "hilo-user/domain/model/diamond_m"
"hilo-user/domain/model/user_m" "hilo-user/domain/model/user_m"
"hilo-user/myerr"
"hilo-user/myerr/bizerr" "hilo-user/myerr/bizerr"
) )
...@@ -37,7 +39,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -37,7 +39,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return err return err
} }
if myCp.Id > 0 { if myCp.Id > 0 {
return msg.GetErrByLanguage(model, 0, lang, comerr.InvalidParameter) return msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp)
} }
// 对方是否已经有cp了 // 对方是否已经有cp了
inviCp, err := cp_m.GetCp(model, userInvite.ID) inviCp, err := cp_m.GetCp(model, userInvite.ID)
...@@ -45,7 +47,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -45,7 +47,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return err return err
} }
if inviCp.Id > 0 { if inviCp.Id > 0 {
return msg.GetErrByLanguage(model, 0, lang, comerr.InvalidParameter) return msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp)
} }
// 我是否发起过cp邀请,且还未被处理 // 我是否发起过cp邀请,且还未被处理
...@@ -58,6 +60,14 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -58,6 +60,14 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return bizerr.CpAlreadyInvite return bizerr.CpAlreadyInvite
} }
content, err := msg.GetResMultiTextBy(model, common.MSG_ID_WANT_BE_YOUR_CP, lang)
if err != nil {
return err
}
tip, err := msg.GetResMultiTextBy(model, common.MSG_ID_EXPIRES_AFTER_24_H, lang)
if err != nil {
return err
}
err = model.Transaction(func(model *domain.Model) error { err = model.Transaction(func(model *domain.Model) error {
// 创建邀请记录 // 创建邀请记录
cpInvId, err := cp_m.CreateCpInvite(model, myUserId, userInvite.ID, cp_e.CpRelationInviteDiamond) cpInvId, err := cp_m.CreateCpInvite(model, myUserId, userInvite.ID, cp_e.CpRelationInviteDiamond)
...@@ -74,8 +84,8 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -74,8 +84,8 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
// 发送私信-邀请 // 发送私信-邀请
data, _ := json.Marshal(cp_m.CpInviteMessage{ data, _ := json.Marshal(cp_m.CpInviteMessage{
Identifier: "CpInviteMessage", Identifier: "CpInviteMessage",
Msg: "Do you want to be CP with me?", Msg: content,
Tip: "24 hours automatic expiration", Tip: tip,
Sender: user_m.ToUserTiny(user), Sender: user_m.ToUserTiny(user),
}) })
if err := tencentyun.BatchSendCustomMsg(model, 1, user.ExternalId, []string{userInvite.ExternalId}, string(data), "cp邀请"); err != nil { if err := tencentyun.BatchSendCustomMsg(model, 1, user.ExternalId, []string{userInvite.ExternalId}, string(data), "cp邀请"); err != nil {
...@@ -89,7 +99,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -89,7 +99,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return err return err
} }
// socket 推送弹窗 // socket 推送弹窗
go rpc.SendCpInviteNotice(userInvite.ID, user.Code, user.Nick, user.Avatar, "Do you want to be CP with me?", user.ExternalId) go rpc.SendCpInviteNotice(userInvite.ID, user.Code, user.Nick, user.Avatar, content, user.ExternalId)
return nil return nil
} }
...@@ -109,13 +119,22 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -109,13 +119,22 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return bizerr.InvalidParameter return bizerr.InvalidParameter
} }
tip, err := msg.GetResMultiTextBy(model, common.MSG_ID_EXPIRES_AFTER_24_H, lang)
if err != nil {
return err
}
content, err := msg.GetResMultiTextBy(model, common.MSG_ID_WANT_UNBIND_CP, lang)
if err != nil {
return err
}
// 自己没有cp了 // 自己没有cp了
myCp, err := cp_m.GetCp(model, myUserId) myCp, err := cp_m.GetCp(model, myUserId)
if err != nil { if err != nil {
return err return err
} }
if myCp.Id == 0 { if myCp.Id == 0 {
return msg.GetErrByLanguage(model, 0, lang, comerr.InvalidParameter) return myerr.WrapErr(bizerr.InvalidParameter)
} }
// 对方没有cp了 // 对方没有cp了
inviCp, err := cp_m.GetCp(model, userRec.ID) inviCp, err := cp_m.GetCp(model, userRec.ID)
...@@ -123,7 +142,7 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -123,7 +142,7 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
return err return err
} }
if inviCp.Id == 0 { if inviCp.Id == 0 {
return msg.GetErrByLanguage(model, 0, lang, comerr.InvalidParameter) return myerr.WrapErr(bizerr.InvalidParameter)
} }
// 是否有关于我的cp解除申请,且还未被处理 // 是否有关于我的cp解除申请,且还未被处理
...@@ -146,8 +165,8 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l ...@@ -146,8 +165,8 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
// 发送私信-发起解除 // 发送私信-发起解除
data, _ := json.Marshal(cp_m.CpCancelMessage{ data, _ := json.Marshal(cp_m.CpCancelMessage{
Identifier: "CpCancelMessage", Identifier: "CpCancelMessage",
Msg: "I want to unbind the CP relationship", Msg: content,
Tip: "24 hours automatic expiration", Tip: tip,
Sender: user_m.ToUserTiny(user), Sender: user_m.ToUserTiny(user),
}) })
if err := tencentyun.BatchSendCustomMsg(model, 1, user.ExternalId, []string{userRec.ExternalId}, string(data), "cp解除"); err != nil { if err := tencentyun.BatchSendCustomMsg(model, 1, user.ExternalId, []string{userRec.ExternalId}, string(data), "cp解除"); err != nil {
......
...@@ -42,3 +42,155 @@ CREATE TABLE `cp_cancel` ( ...@@ -42,3 +42,155 @@ CREATE TABLE `cp_cancel` (
KEY `status_idx` (`status`) USING BTREE, KEY `status_idx` (`status`) USING BTREE,
KEY `created_time` (`created_time`) KEY `created_time` (`created_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='cp解除发起记录'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='cp解除发起记录';
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (242, 'zh', '仅限送给CP'),
(242, 'en', 'Only for CP'),
(242, 'ar', 'فقط من أجل CP'),
(242, 'tr', 'Sadece CP için'),
(242, 'id', 'Hanya untuk CP'),
(242, 'ru', 'Только для КП'),
(242, 'ko', 'CP 전용'),
(242, 'pt', 'Somente para CP'),
(242, 'th', 'สำหรับซีพีเท่านั้น'),
(242, 'ca', 'Solo para CP'),
(242, 'hi', 'केवल सीपी के लिए'),
(242, 'vi', 'Chỉ dành cho CP'),
(242, 'ur', 'صرف CP کے لیے');
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (243, 'zh', '对方已有CP了'),
(243, 'en', 'The opponent already has CP'),
(243, 'ar', 'الطرف الآخر لديه بالفعل CP'),
(243, 'tr', "Rakibin zaten CP'si var"),
(243, 'id', 'Lawan sudah memiliki CP'),
(243, 'ru', 'У противника уже есть CP'),
(243, 'ko', '상대는 이미 CP를 가지고 있습니다.'),
(243, 'pt', 'O oponente já tem CP'),
(243, 'th', 'ฝ่ายตรงข้ามมี CP อยู่แล้ว'),
(243, 'ca', 'El oponente ya tiene CP'),
(243, 'hi', 'विरोधी के पास पहले से ही CP है'),
(243, 'vi', 'Đối thủ đã có CP'),
(243, 'ur', 'مخالف کے پاس پہلے ہی سی پی ہے۔');
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (244, 'zh', "你想要和我成为CP吗?"),
(244, 'en', "Do you want to be CP with me?"),
(244, 'ar', "هل ترغب في ان تكون CP الخاص معي؟"),
(244, 'tr', "Benimle CP olmak ister misin?"),
(244, 'id', "Apakah Anda ingin menjadi CP dengan saya?"),
(244, 'ru', "Хочешь быть со мной?"),
(244, 'ko', "나랑 CP할래?"),
(244, 'pt', "Você quer ser CP comigo?"),
(244, 'th', "อยากเป็น CP กับฉันไหม?"),
(244, 'ca', "¿Quieres ser CP conmigo?"),
(244, 'hi', "क्या आप मेरे साथ सीपी बनना चाहते हैं?"),
(244, 'vi', "Bạn có muốn trở thành CP với tôi không?"),
(244, 'ur', "کیا آپ میرے ساتھ CP بننا چاہتے ہیں؟");
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (245, 'zh', "我想成为你的CP"),
(245, 'en', "I want to be your CP"),
(245, 'ar', "أريد أن أكون CP الخاص بك"),
(245, 'tr', "senin CP'n olmak istiyorum"),
(245, 'id', "Saya ingin menjadi CP Anda"),
(245, 'ru', "Я хочу быть твоим CP"),
(245, 'ko', "당신의 CP가 되고 싶습니다"),
(245, 'pt', "quero ser seu cp"),
(245, 'th', "ฉันอยากเป็นซีพีของคุณ"),
(245, 'ca', "quiero ser tu CP"),
(245, 'hi', "मैं आपका सीपी बनना चाहता हूं"),
(245, 'vi', "Tôi muốn trở thành CP của bạn"),
(245, 'ur', "میں آپ کا CP بننا چاہتا ہوں۔");
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (246, 'zh', "24小时后自动失效"),
(246, 'en', "Automatically expires after 24 hours"),
(246, 'ar', "تنتهي الصلاحية تلقائيًا بعد 24 ساعة"),
(246, 'tr', "24 saat sonra otomatik olarak sona erer"),
(246, 'id', "Secara otomatis kedaluwarsa setelah 24 jam"),
(246, 'ru', "Автоматически истекает через 24 часа"),
(246, 'ko', "24시간 후 자동 만료"),
(246, 'pt', "Expira automaticamente após 24 horas"),
(246, 'th', "หมดอายุโดยอัตโนมัติหลังจาก 24 ชั่วโมง"),
(246, 'ca', "Caduca automáticamente después de 24 horas"),
(246, 'hi', "24 घंटे के बाद स्वतः समाप्त हो जाता है"),
(246, 'vi', "Tự động hết hạn sau 24 giờ"),
(246, 'ur', "24 گھنٹے کے بعد خود بخود ختم ہو جاتا ہے۔");
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (247, 'zh', "我想解绑CP"),
(247, 'en', "I want to unbind CP"),
(247, 'ar', "أريد فك ارتباط CP"),
(247, 'tr', "CP bağlantısını kaldırmak istiyorum"),
(247, 'id', "Saya ingin melepaskan CP"),
(247, 'ru', "Я хочу отвязать CP"),
(247, 'ko', "CP 바인딩을 해제하고 싶습니다."),
(247, 'pt', "quero desvincular o CP"),
(247, 'th', "ฉันต้องการยกเลิกการเชื่อมโยง CP"),
(247, 'ca', "Quiero desvincular CP"),
(247, 'hi', "मैं सीपी को खोलना चाहता हूं"),
(247, 'vi', "Tôi muốn hủy liên kết CP"),
(247, 'ur', "میں CP کو بند کرنا چاہتا ہوں۔");
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (248, 'zh', "我们已经是CP了!"),
(248, 'en', "We are already CP!"),
(248, 'ar', "أصبحنا CP!"),
(248, 'tr', "Biz zaten CP'yiz!"),
(248, 'id', "Kami sudah CP!"),
(248, 'ru', "Мы уже КП!"),
(248, 'ko', "우리는 이미 CP입니다!"),
(248, 'pt', "Já somos CP!"),
(248, 'th', "เราเป็นซีพีแล้ว!"),
(248, 'ca', "¡Ya somos CP!"),
(248, 'hi', "हम पहले से ही सीपी हैं!"),
(248, 'vi', "Chúng ta đã là CP rồi!"),
(248, 'ur', "ہم پہلے ہی CP ہیں!");
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (249, 'zh', "庆祝礼物已发送到%s的背包"),
(249, 'en', "Celebration gifts have been sent to %s' backpack"),
(249, 'ar', "تم إرسال هدايا الاحتفال إلى حقيبة ٪ s"),
(249, 'tr', "%s'nin sırt çantasına kutlama hediyeleri gönderildi"),
(249, 'id', "Hadiah perayaan telah dikirim ke ransel %s"),
(249, 'ru', "Праздничные подарки отправлены в рюкзак %s."),
(249, 'ko', "축하 선물이 %s의 배낭으로 보내졌습니다."),
(249, 'pt', "Presentes de comemoração foram enviados para a mochila de %s"),
(249, 'th', "ของขวัญฉลองถูกส่งไปที่กระเป๋าเป้สะพายหลังของ %s แล้ว"),
(249, 'ca', "Se han enviado regalos de celebración a la mochila de %s"),
(249, 'hi', "उत्सव उपहार %s के बैकपैक में भेज दिए गए हैं"),
(249, 'vi', "Quà kỷ niệm đã được gửi tới ba lô của %s'"),
(249, 'ur', "جشن کے تحائف %s کے بیگ میں بھیجے گئے ہیں۔");
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (250, 'zh', "%s已拒绝CP邀请"),
(250, 'en', "%s has rejected the CP invitation"),
(250, 'ar', "٪ s رفض دعوة CP"),
(250, 'tr', "%s CP davetini reddetti"),
(250, 'id', "%s telah menolak undangan CP"),
(250, 'ru', "%s отклонил приглашение CP"),
(250, 'ko', "%s님이 CP 초대를 거부했습니다."),
(250, 'pt', "%s rejeitou o convite CP"),
(250, 'th', "%s ได้ปฏิเสธคำเชิญ CP"),
(250, 'ca', "%s ha rechazado la invitación de CP"),
(250, 'hi', "%s ने CP आमंत्रण को अस्वीकार कर दिया है"),
(250, 'vi', "%s đã từ chối lời mời CP"),
(250, 'ur', "%s نے CP دعوت نامے کو مسترد کر دیا ہے۔");
INSERT INTO hilo.res_multi_text (msg_id, `language`, content)
VALUES (251, 'zh', "已解绑CP,CP值被清空,CP特权已消失"),
(251, 'en', "The CP has been unbound, the CP points has been cleared, and the CP privilege has disappeared"),
(251, 'ar', "تم فك ارتباط CP ، وتم مسح نقاط CP ، واختفيت امتيازات CP"),
(251, 'tr', "CP bağlantısı kaldırıldı, CP puanları silindi ve CP ayrıcalığı kayboldu"),
(251, 'id', "CP telah dilepas, poin CP telah dihapus, dan hak istimewa CP telah hilang"),
(251, 'ru', "CP был развязан, CP-очки были очищены, а привилегия CP исчезла."),
(251, 'ko', "CP가 해제되고 CP 포인트가 해제되며 CP 특권이 사라졌습니다."),
(251, 'pt', "O CP foi desvinculado, os pontos do CP foram apagados e o privilégio do CP desapareceu"),
(251, 'th', "CP ไม่ถูกผูกมัด คะแนน CP ถูกล้าง และสิทธิ์ CP หายไป"),
(251, 'ca', "El CP se ha desvinculado, los puntos de CP se han borrado y el privilegio de CP ha desaparecido"),
(251, 'hi', "सीपी अनबाउंड हो गया है, सीपी पॉइंट क्लियर हो गए हैं, और सीपी विशेषाधिकार गायब हो गया है"),
(251, 'vi', "CP đã bị hủy liên kết, điểm CP đã bị xóa và đặc quyền CP đã biến mất"),
(251, 'ur', "CP کو غیر پابند کر دیا گیا ہے، CP پوائنٹس کو صاف کر دیا گیا ہے، اور CP کا استحقاق غائب ہو گیا ہے");
\ No newline at end of file
...@@ -3,6 +3,7 @@ package cp_r ...@@ -3,6 +3,7 @@ package cp_r
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"git.hilo.cn/hilo-common/_const/common"
"git.hilo.cn/hilo-common/_const/enum/diamond_e" "git.hilo.cn/hilo-common/_const/enum/diamond_e"
"git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext" "git.hilo.cn/hilo-common/mycontext"
...@@ -61,10 +62,14 @@ func CheckUserCpRelation(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -61,10 +62,14 @@ func CheckUserCpRelation(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, err return myCtx, err
} }
if cp.Id > 0 { if cp.Id > 0 {
return myCtx, msg.GetErrByLanguage(model, 0, lang, comerr.InvalidParameter) // cwj---- return myCtx, msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp)
}
msg, err := msg.GetResMultiTextBy(model, common.MSG_ID_INVITE_CP, lang)
if err != nil {
return myCtx, err
} }
resp.ResponseOk(c, cp_cv.CheckCpRelationRes{Diamond: cp_e.CpRelationInviteDiamond, Msg: "Do you want to be CP with me?"}) resp.ResponseOk(c, cp_cv.CheckCpRelationRes{Diamond: cp_e.CpRelationInviteDiamond, Msg: msg})
return myCtx, nil return myCtx, nil
} }
...@@ -161,7 +166,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -161,7 +166,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, err return myCtx, err
} }
if myCp.Id > 0 { if myCp.Id > 0 {
return myCtx, msg.GetErrByLanguage(model, 0, lang, comerr.InvalidParameter) return myCtx, msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp)
} }
// 对方是否已经有cp了 // 对方是否已经有cp了
senderCp, err := cp_m.GetCp(model, userSender.ID) senderCp, err := cp_m.GetCp(model, userSender.ID)
...@@ -169,7 +174,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -169,7 +174,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, err return myCtx, err
} }
if senderCp.Id > 0 { if senderCp.Id > 0 {
return myCtx, msg.GetErrByLanguage(model, 0, lang, comerr.InvalidParameter) return myCtx, msg.GetErrByLanguage(model, common.MSG_ID_ALREADY_HAS_CP, lang, comerr.AlreadyHasCp)
} }
} }
err = model.Transaction(func(model *domain.Model) error { err = model.Transaction(func(model *domain.Model) error {
...@@ -206,7 +211,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -206,7 +211,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
model.Log.Errorf("ReplyCpInvite InitCpAnniversary fail:%v-%v-%v", userSender.ID, user.ID, err) model.Log.Errorf("ReplyCpInvite InitCpAnniversary fail:%v-%v-%v", userSender.ID, user.ID, err)
return err return err
} }
// 发放告白礼物 cwj---- // 发放告白礼物
if _, err = bag_tx.SendUserBag(model, userSender.ID, 1, cp_e.CpConfessionGiftId, 1, 3, "告白礼物"); err != nil { if _, err = bag_tx.SendUserBag(model, userSender.ID, 1, cp_e.CpConfessionGiftId, 1, 3, "告白礼物"); err != nil {
model.Log.Errorf("ReplyCpInvite userSender:%d, user:%d, status:%d, err:%v", userSender.ID, user.ID, updateStatus, err) model.Log.Errorf("ReplyCpInvite userSender:%d, user:%d, status:%d, err:%v", userSender.ID, user.ID, updateStatus, err)
return err return err
...@@ -221,10 +226,18 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -221,10 +226,18 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
// return err // return err
//} //}
// 私信-接受 // 私信-接受
content, err := msg.GetResMultiTextBy(model, common.MSG_ID_BIND_CP_SUCCEED, lang)
if err != nil {
return err
}
tip, err := msg.GetResMultiTextBy(model, common.MSG_ID_SEND_CP_GIFT, lang)
if err != nil {
return err
}
msgData, _ = json.Marshal(cp_m.CpAcceptInviteMessage{ msgData, _ = json.Marshal(cp_m.CpAcceptInviteMessage{
Identifier: "CpAcceptInviteMessage", Identifier: "CpAcceptInviteMessage",
Msg: "We are already CP!", Msg: content,
Tip: fmt.Sprintf("Celebration gifts have been sent to %s's backpack", userSender.Code), Tip: fmt.Sprintf(tip, userSender.Code),
Sender: user_m.ToUserTiny(userSender), Sender: user_m.ToUserTiny(userSender),
Receiver: user_m.ToUserTiny(user), Receiver: user_m.ToUserTiny(user),
}) })
...@@ -236,9 +249,13 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -236,9 +249,13 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
return err return err
} }
// 私信-拒绝 // 私信-拒绝
content, err := msg.GetResMultiTextBy(model, common.MSG_ID_REJECTED_CP_INVITE, lang)
if err != nil {
return err
}
msgData, _ = json.Marshal(cp_m.CpDenyInviteMessage{ msgData, _ = json.Marshal(cp_m.CpDenyInviteMessage{
Identifier: "CpDenyInviteMessage", Identifier: "CpDenyInviteMessage",
Msg: fmt.Sprintf("%s have declined the CP invitation", user.Nick), Msg: fmt.Sprintf(content, user.Nick),
Sender: user_m.ToUserTiny(user), Sender: user_m.ToUserTiny(user),
}) })
} }
...@@ -274,7 +291,7 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -274,7 +291,7 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) {
return myCtx, bizerr.InvalidParameter return myCtx, bizerr.InvalidParameter
} }
myUserId, _, err := req.GetUserIdLang(c, myCtx) myUserId, lang, err := req.GetUserIdLang(c, myCtx)
if err != nil { if err != nil {
return myCtx, err return myCtx, err
} }
...@@ -327,9 +344,13 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -327,9 +344,13 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) {
var msgData []byte var msgData []byte
if optType == 1 { // 撤销解除 if optType == 1 { // 撤销解除
// 私信 // 私信
//content, err := msg.GetResMultiTextBy(model, common.MSG_ID_UNBIND_CP_SUCCEED, lang)
//if err != nil {
// return err
//}
msgData, _ = json.Marshal(cp_m.CpDealCancelMessage{ msgData, _ = json.Marshal(cp_m.CpDealCancelMessage{
Identifier: "CpDealCancelMessage", Identifier: "CpDealCancelMessage",
Msg: fmt.Sprintf("%s withdrew my application to lift CP", myUser.Nick), Msg: fmt.Sprintf("%s withdrew my application to lift CP", myUser.Nick), // cwj----
Status: 1, Status: 1,
}) })
} else { // 接受解除 } else { // 接受解除
...@@ -340,9 +361,13 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -340,9 +361,13 @@ func ReplyCpCancel(c *gin.Context) (*mycontext.MyContext, error) {
return err return err
} }
// 私信-接受解除 // 私信-接受解除
content, err := msg.GetResMultiTextBy(model, common.MSG_ID_UNBIND_CP_SUCCEED, lang)
if err != nil {
return err
}
msgData, _ = json.Marshal(cp_m.CpDealCancelMessage{ msgData, _ = json.Marshal(cp_m.CpDealCancelMessage{
Identifier: "CpDealCancelMessage", Identifier: "CpDealCancelMessage",
Msg: "The CP relationship has been unbound, the CP value has been cleared, and the CP privilege has disappeared", Msg: content,
Status: 2, Status: 2,
}) })
} }
......
...@@ -57,7 +57,7 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -57,7 +57,7 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) {
Count: bagGift.Count, Count: bagGift.Count,
RemainDays: int(bagGift.EndTime.Sub(time.Now()).Hours() / 24), RemainDays: int(bagGift.EndTime.Sub(time.Now()).Hours() / 24),
} }
if gift.ID == cp_e.CpConfessionGiftId { // cwj---- 如果是cp告白礼物 if gift.ID == cp_e.CpConfessionGiftId { // 如果是cp告白礼物
info.TextStyleList = make([]*user_cv.TextStyle, 0, 2) info.TextStyleList = make([]*user_cv.TextStyle, 0, 2)
info.TextStyleList = append(info.TextStyleList, info.TextStyleList = append(info.TextStyleList,
&user_cv.TextStyle{TextColor: "#ce0083", TextSize: 20, TextKey: "sender_name"}, &user_cv.TextStyle{TextColor: "#ce0083", TextSize: 20, TextKey: "sender_name"},
......
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