作者 yangfu

更新已读

... ... @@ -17,7 +17,7 @@ import (
func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCenterRequest) (rsp *protocol.MessageCenterResponse, err error) {
var ()
rsp = &protocol.MessageCenterResponse{}
err = models.GetUserMsgTotals(header.Uid, header.CompanyId, request.MsgType, &rsp.Totals)
err = models.GetUserMsgTotals(header.UserId, header.CompanyId, request.MsgType, &rsp.Totals)
return
}
... ... @@ -35,7 +35,7 @@ func MsgCenterRead(header *protocol.RequestHeader, request *protocol.MsgCenterRe
if msg.IsRead == 1 {
return
}
err = models.UpdateUserMsgSetRead(header.Uid, header.CompanyId, request.MsgType, request.MsgId)
err = models.UpdateUserMsgSetRead(header.UserId, header.CompanyId, request.MsgType, request.MsgId)
if err != nil {
log.Error(err)
}
... ... @@ -46,7 +46,7 @@ func MsgCenterRead(header *protocol.RequestHeader, request *protocol.MsgCenterRe
func MsgCenterAllRead(header *protocol.RequestHeader, request *protocol.MsgCenterAllReadRequest) (rsp *protocol.MsgCenterAllReadResponse, err error) {
var ()
rsp = &protocol.MsgCenterAllReadResponse{}
err = models.UpdateUserMsgSetRead(header.Uid, header.CompanyId, request.MsgType, 0)
err = models.UpdateUserMsgSetRead(header.UserId, header.CompanyId, request.MsgType, 0)
if err != nil {
log.Error(err)
}
... ... @@ -59,7 +59,7 @@ func MsgInteractive(header *protocol.RequestHeader, request *protocol.MsgInterac
userMsgs []*models.UserMsg
)
rsp = &protocol.MsgInteractiveResponse{}
userMsgs, rsp.Total, err = models.GetUserMsgs(header.Uid, header.CompanyId, request.MsgType, request.SourceType, request.LastId, request.PageSize)
userMsgs, rsp.Total, err = models.GetUserMsgs(header.UserId, header.CompanyId, request.MsgType, request.SourceType, request.LastId, request.PageSize)
if err != nil {
log.Error(err)
return
... ...