Commit e7b378bf authored by chenweijian's avatar chenweijian

cp im

parent 2afef13c
......@@ -29,6 +29,7 @@ type CpInvite struct {
type CpInviteMessage struct {
Identifier string `json:"identifier"`
Msg string `json:"msg"`
Tip string `json:"tip"`
Sender *user_m.UserTiny `json:"sender"`
}
......@@ -36,6 +37,7 @@ type CpInviteMessage struct {
type CpAcceptInviteMessage struct {
Identifier string `json:"identifier"`
Msg string `json:"msg"`
Tip string `json:"tip"`
Sender *user_m.UserTiny `json:"sender"`
Receiver *user_m.UserTiny `json:"receiver"`
}
......@@ -58,6 +60,7 @@ type CpCancel struct {
type CpCancelMessage struct {
Identifier string `json:"identifier"`
Msg string `json:"msg"`
Tip string `json:"tip"`
Sender *user_m.UserTiny `json:"sender"`
}
......
......@@ -75,6 +75,7 @@ func InviteCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
data, _ := json.Marshal(cp_m.CpInviteMessage{
Identifier: "CpInviteMessage",
Msg: "Do you want to be CP with me?",
Tip: "24 hours automatic expiration",
Sender: user_m.ToUserTiny(user),
})
if err := tencentyun.BatchSendCustomMsg(model, 1, user.ExternalId, []string{userInvite.ExternalId}, string(data), "cp邀请"); err != nil {
......@@ -146,6 +147,7 @@ func CancelCpRelation(myCtx *mycontext.MyContext, myUserId uint64, externalId, l
data, _ := json.Marshal(cp_m.CpCancelMessage{
Identifier: "CpCancelMessage",
Msg: "I want to unbind the CP relationship",
Tip: "24 hours automatic expiration",
Sender: user_m.ToUserTiny(user),
})
if err := tencentyun.BatchSendCustomMsg(model, 1, user.ExternalId, []string{userRec.ExternalId}, string(data), "cp解除"); err != nil {
......
......@@ -198,6 +198,7 @@ func ReplyCpInvite(c *gin.Context) (*mycontext.MyContext, error) {
msgData, _ = json.Marshal(cp_m.CpAcceptInviteMessage{
Identifier: "CpAcceptInviteMessage",
Msg: "We are already CP!",
Tip: fmt.Sprintf("Celebration gifts have been sent to %s's backpack", userSender.Code),
Sender: user_m.ToUserTiny(userSender),
Receiver: user_m.ToUserTiny(user),
})
......
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