This commit is contained in:
richboo111
2024-01-24 11:33:22 +08:00
parent cfb2932334
commit fcebcaada8

View File

@@ -284,6 +284,9 @@ func SetMessageDetail(req *JXMsg, vendorID int, elmAppID string) error {
}
//生成京西消息ID detail
msgID := GenMsgDetailID(req, vendorID, elmAppID)
if len(msgID) == 0 {
return nil
}
data, _ := json.Marshal(req)
globals.SugarLogger.Debugf("SetMessageDetail data=%s", string(data))
@@ -300,6 +303,9 @@ func SetMessageDetail(req *JXMsg, vendorID int, elmAppID string) error {
func SetUserList(jxMsg *JXMsg, userList *UserMessageList, vendorID int, elmAppID string) error {
//生成msgID
msgID := GenMsgListID(jxMsg, vendorID, elmAppID)
if len(msgID) == 0 {
return nil
}
//获取未读消息条数并删除旧数据
cnt, err := GetNewAndTrim(msgID, userList.UserID)
@@ -347,6 +353,10 @@ func GetNewAndTrim(key string, flag string) (cnt int, err error) {
// GenMsgDetailID 生成查询详细聊天记录ID
func GenMsgDetailID(jxMsg *JXMsg, vendorID int, elmAppID string) (msgID string) {
globals.SugarLogger.Debugf("GenMsgDetailID test0124 jxMsg=%s", utils.Format4Output(jxMsg, false))
if jxMsg == nil {
return ""
}
if vendorID == VendorIDMT {
var d1 = jxMsg.MsgContent.(mtwmapi.PushContentReq)
msgID = utils.Int2Str(d1.AppID) + ":" + d1.AppPoiCode + ":1:" + utils.Int2Str(d1.OpenUserID)
@@ -360,6 +370,11 @@ func GenMsgDetailID(jxMsg *JXMsg, vendorID int, elmAppID string) (msgID string)
// GenMsgListID 生成展示列表时单条数据ID部分
func GenMsgListID(jxMsg *JXMsg, vendorID int, elmAppID string) (msgID string) {
globals.SugarLogger.Debugf("GenMsgListID test0124 jxMsg=%s,vendorID=%d", utils.Format4Output(jxMsg, false), vendorID)
if jxMsg == nil {
return ""
}
if vendorID == VendorIDMT {
var d1 = jxMsg.MsgContent.(mtwmapi.PushContentReq)
msgID = utils.Int2Str(d1.AppID) + ":" + d1.AppPoiCode + ":1"