作者 yangfu

消息修改

... ... @@ -560,6 +560,7 @@ func ChanceApproveProcess(header *protocol.RequestHeader, chance *models.Chance)
}
switch item.ApproveType {
case protocol.AuditByDepartmentor:
item.RoleName = "部门长"
break
case protocol.AuditByUser:
//item.Uid=process.Uid
... ...
... ... @@ -20,6 +20,7 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent
interactionCount int
)
rsp = &protocol.MessageCenterResponse{}
rsp.Totals = make([]*protocol.MessageTotal, 0)
if request.MsgType&protocol.MsgTypeInteraction > 0 {
if request.MsgType&protocol.MsgTypeThumbUp == 0 {
request.MsgType |= protocol.MsgTypeThumbUp
... ... @@ -93,6 +94,7 @@ func MsgInteractive(header *protocol.RequestHeader, request *protocol.MsgInterac
userMsgs []*models.UserMsg
)
rsp = &protocol.MsgInteractiveResponse{}
rsp.Lists = make([]*protocol.UserMsg, 0)
userMsgs, rsp.Total, err = models.GetUserMsgs(header.UserId, header.CompanyId, request.MsgType, request.SourceType, request.LastId, request.PageSize)
if err != nil {
log.Error(err)
... ... @@ -127,6 +129,7 @@ func Announcements(header *protocol.RequestHeader, request *protocol.Announcemen
bulletin *models.Bulletin
)
rsp = &protocol.AnnouncementsResponse{}
rsp.Lists = make([]protocol.Announcement, 0)
if err = utils.ExecuteQueryAll(&userMsg, models.SqlUserMsgsUnRead, header.CompanyId, header.UserId, models.MsgTypeBulletin); err != nil {
if err == orm.ErrNoRows {
err = nil
... ... @@ -216,6 +219,7 @@ func MsgCompanyNotice(header *protocol.RequestHeader, request *protocol.MsgCompa
}
rsp = &protocol.MsgCompanyNoticeResponse{}
rsp.Total = total
rsp.Lists = make([]protocol.UserMsg, 0)
for i := range msgBulletins {
tmp := msgBulletins[i]
rsp.Lists = append(rsp.Lists, protocol.UserMsg{
... ... @@ -247,6 +251,7 @@ func MsgChanceApprove(header *protocol.RequestHeader, request *protocol.MsgChanc
return
}
rsp = &protocol.MsgChanceApproveResponse{Total: total}
rsp.List = make([]protocol.MsgCommonListItem, 0)
for i := 0; i < len(myChances); i++ {
chance := myChances[i]
commItem := protocol.MsgCommonListItem{}
... ... @@ -308,6 +313,7 @@ func MsgChanceSubmit(header *protocol.RequestHeader, request *protocol.MsgChance
return
}
rsp = &protocol.MsgChanceSubmitResponse{Total: total}
rsp.List = make([]protocol.MsgCommonListItem, 0)
for i := 0; i < len(myChances); i++ {
chance := myChances[i]
commItem := protocol.MsgCommonListItem{}
... ... @@ -369,6 +375,7 @@ func MsgChanceComment(header *protocol.RequestHeader, request *protocol.MsgChanc
return
}
rsp = &protocol.MsgChanceCommentResponse{Total: total}
rsp.List = make([]protocol.MsgCommonListItem, 0)
for i := 0; i < len(myChances); i++ {
chance := myChances[i]
commItem := protocol.MsgCommonListItem{}
... ... @@ -442,6 +449,7 @@ func MsgChanceThumbUp(header *protocol.RequestHeader, request *protocol.MsgChanc
return
}
rsp = &protocol.MsgChanceThumbUpResponse{Total: total}
rsp.List = make([]protocol.MsgCommonListItem, 0)
for i := 0; i < len(myChances); i++ {
chance := myChances[i]
commItem := protocol.MsgCommonListItem{}
... ...