作者 yangfu

更新已读

@@ -17,7 +17,7 @@ import ( @@ -17,7 +17,7 @@ import (
17 func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCenterRequest) (rsp *protocol.MessageCenterResponse, err error) { 17 func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCenterRequest) (rsp *protocol.MessageCenterResponse, err error) {
18 var () 18 var ()
19 rsp = &protocol.MessageCenterResponse{} 19 rsp = &protocol.MessageCenterResponse{}
20 - err = models.GetUserMsgTotals(header.Uid, header.CompanyId, request.MsgType, &rsp.Totals) 20 + err = models.GetUserMsgTotals(header.UserId, header.CompanyId, request.MsgType, &rsp.Totals)
21 return 21 return
22 } 22 }
23 23
@@ -35,7 +35,7 @@ func MsgCenterRead(header *protocol.RequestHeader, request *protocol.MsgCenterRe @@ -35,7 +35,7 @@ func MsgCenterRead(header *protocol.RequestHeader, request *protocol.MsgCenterRe
35 if msg.IsRead == 1 { 35 if msg.IsRead == 1 {
36 return 36 return
37 } 37 }
38 - err = models.UpdateUserMsgSetRead(header.Uid, header.CompanyId, request.MsgType, request.MsgId) 38 + err = models.UpdateUserMsgSetRead(header.UserId, header.CompanyId, request.MsgType, request.MsgId)
39 if err != nil { 39 if err != nil {
40 log.Error(err) 40 log.Error(err)
41 } 41 }
@@ -46,7 +46,7 @@ func MsgCenterRead(header *protocol.RequestHeader, request *protocol.MsgCenterRe @@ -46,7 +46,7 @@ func MsgCenterRead(header *protocol.RequestHeader, request *protocol.MsgCenterRe
46 func MsgCenterAllRead(header *protocol.RequestHeader, request *protocol.MsgCenterAllReadRequest) (rsp *protocol.MsgCenterAllReadResponse, err error) { 46 func MsgCenterAllRead(header *protocol.RequestHeader, request *protocol.MsgCenterAllReadRequest) (rsp *protocol.MsgCenterAllReadResponse, err error) {
47 var () 47 var ()
48 rsp = &protocol.MsgCenterAllReadResponse{} 48 rsp = &protocol.MsgCenterAllReadResponse{}
49 - err = models.UpdateUserMsgSetRead(header.Uid, header.CompanyId, request.MsgType, 0) 49 + err = models.UpdateUserMsgSetRead(header.UserId, header.CompanyId, request.MsgType, 0)
50 if err != nil { 50 if err != nil {
51 log.Error(err) 51 log.Error(err)
52 } 52 }
@@ -59,7 +59,7 @@ func MsgInteractive(header *protocol.RequestHeader, request *protocol.MsgInterac @@ -59,7 +59,7 @@ func MsgInteractive(header *protocol.RequestHeader, request *protocol.MsgInterac
59 userMsgs []*models.UserMsg 59 userMsgs []*models.UserMsg
60 ) 60 )
61 rsp = &protocol.MsgInteractiveResponse{} 61 rsp = &protocol.MsgInteractiveResponse{}
62 - userMsgs, rsp.Total, err = models.GetUserMsgs(header.Uid, header.CompanyId, request.MsgType, request.SourceType, request.LastId, request.PageSize) 62 + userMsgs, rsp.Total, err = models.GetUserMsgs(header.UserId, header.CompanyId, request.MsgType, request.SourceType, request.LastId, request.PageSize)
63 if err != nil { 63 if err != nil {
64 log.Error(err) 64 log.Error(err)
65 return 65 return