Skip to content

Commit 81bcf05

Browse files
committed
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
2 parents 006e929 + 3779e3e commit 81bcf05

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

Diff for: internal/conversation_msg/conversation_msg.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
113113
//}
114114
msg := new(sdk_struct.MsgStruct)
115115
copier.Copy(msg, v)
116+
var tips server_api_params.TipsComm
116117
if v.ContentType >= constant.NotificationBegin && v.ContentType <= constant.NotificationEnd {
117-
var tips server_api_params.TipsComm
118118
_ = proto.Unmarshal(v.Content, &tips)
119119
marshaler := jsonpb.Marshaler{
120120
OrigName: true,
@@ -175,7 +175,7 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
175175
c.organization.DoNotification(v, c.ch, operationID)
176176
} else if v.ContentType == constant.WorkMomentNotification {
177177
log.Info(operationID, "WorkMoment New Notification")
178-
c.workMoments.DoNotification(v, operationID)
178+
c.workMoments.DoNotification(tips.JsonDetail, operationID)
179179
}
180180
case constant.GroupChatType:
181181
if v.ContentType > constant.GroupNotificationBegin && v.ContentType < constant.GroupNotificationEnd {

Diff for: internal/work_moments/work_moments.go

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package workMoments
22

33
import (
4-
"github.com/golang/protobuf/proto"
54
ws "open_im_sdk/internal/interaction"
65
"open_im_sdk/open_im_sdk_callback"
76
"open_im_sdk/pkg/common"
87
"open_im_sdk/pkg/db"
98
"open_im_sdk/pkg/log"
109
"open_im_sdk/pkg/sdk_params_callback"
11-
"open_im_sdk/pkg/server_api_params"
1210
"open_im_sdk/pkg/utils"
1311
)
1412

@@ -23,14 +21,9 @@ func NewWorkMoments(loginUserID string, db *db.DataBase, p *ws.PostApi) *WorkMom
2321
return &WorkMoments{loginUserID: loginUserID, db: db, p: p}
2422
}
2523

26-
func (w *WorkMoments) DoNotification(msg *server_api_params.MsgData, operationID string) {
27-
log.NewInfo(operationID, utils.GetSelfFuncName(), string(msg.Content))
28-
var tips server_api_params.TipsComm
29-
if err := proto.Unmarshal(msg.Content, &tips); err != nil {
30-
log.NewError(operationID, utils.GetSelfFuncName(), err.Error())
31-
}
32-
log.NewInfo(operationID, utils.GetSelfFuncName(), "json_detail: ", tips.JsonDetail)
33-
if err := w.db.InsertWorkMomentsNotification(tips.JsonDetail); err != nil {
24+
func (w *WorkMoments) DoNotification(jsonDetailStr string, operationID string) {
25+
log.NewInfo(operationID, utils.GetSelfFuncName(), "json_detail: ", jsonDetailStr)
26+
if err := w.db.InsertWorkMomentsNotification(jsonDetailStr); err != nil {
3427
log.NewError(operationID, utils.GetSelfFuncName(), "InsertWorkMomentsNotification failed", err.Error())
3528
return
3629
}

0 commit comments

Comments
 (0)