|
@@ -20,6 +20,7 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent |
|
@@ -20,6 +20,7 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent |
20
|
interactionCount int
|
20
|
interactionCount int
|
21
|
)
|
21
|
)
|
22
|
rsp = &protocol.MessageCenterResponse{}
|
22
|
rsp = &protocol.MessageCenterResponse{}
|
|
|
23
|
+ rsp.Totals = make([]*protocol.MessageTotal, 0)
|
23
|
if request.MsgType&protocol.MsgTypeInteraction > 0 {
|
24
|
if request.MsgType&protocol.MsgTypeInteraction > 0 {
|
24
|
if request.MsgType&protocol.MsgTypeThumbUp == 0 {
|
25
|
if request.MsgType&protocol.MsgTypeThumbUp == 0 {
|
25
|
request.MsgType |= protocol.MsgTypeThumbUp
|
26
|
request.MsgType |= protocol.MsgTypeThumbUp
|
|
@@ -93,6 +94,7 @@ func MsgInteractive(header *protocol.RequestHeader, request *protocol.MsgInterac |
|
@@ -93,6 +94,7 @@ func MsgInteractive(header *protocol.RequestHeader, request *protocol.MsgInterac |
93
|
userMsgs []*models.UserMsg
|
94
|
userMsgs []*models.UserMsg
|
94
|
)
|
95
|
)
|
95
|
rsp = &protocol.MsgInteractiveResponse{}
|
96
|
rsp = &protocol.MsgInteractiveResponse{}
|
|
|
97
|
+ rsp.Lists = make([]*protocol.UserMsg, 0)
|
96
|
userMsgs, rsp.Total, err = models.GetUserMsgs(header.UserId, header.CompanyId, request.MsgType, request.SourceType, request.LastId, request.PageSize)
|
98
|
userMsgs, rsp.Total, err = models.GetUserMsgs(header.UserId, header.CompanyId, request.MsgType, request.SourceType, request.LastId, request.PageSize)
|
97
|
if err != nil {
|
99
|
if err != nil {
|
98
|
log.Error(err)
|
100
|
log.Error(err)
|
|
@@ -127,6 +129,7 @@ func Announcements(header *protocol.RequestHeader, request *protocol.Announcemen |
|
@@ -127,6 +129,7 @@ func Announcements(header *protocol.RequestHeader, request *protocol.Announcemen |
127
|
bulletin *models.Bulletin
|
129
|
bulletin *models.Bulletin
|
128
|
)
|
130
|
)
|
129
|
rsp = &protocol.AnnouncementsResponse{}
|
131
|
rsp = &protocol.AnnouncementsResponse{}
|
|
|
132
|
+ rsp.Lists = make([]protocol.Announcement, 0)
|
130
|
if err = utils.ExecuteQueryAll(&userMsg, models.SqlUserMsgsUnRead, header.CompanyId, header.UserId, models.MsgTypeBulletin); err != nil {
|
133
|
if err = utils.ExecuteQueryAll(&userMsg, models.SqlUserMsgsUnRead, header.CompanyId, header.UserId, models.MsgTypeBulletin); err != nil {
|
131
|
if err == orm.ErrNoRows {
|
134
|
if err == orm.ErrNoRows {
|
132
|
err = nil
|
135
|
err = nil
|
|
@@ -216,6 +219,7 @@ func MsgCompanyNotice(header *protocol.RequestHeader, request *protocol.MsgCompa |
|
@@ -216,6 +219,7 @@ func MsgCompanyNotice(header *protocol.RequestHeader, request *protocol.MsgCompa |
216
|
}
|
219
|
}
|
217
|
rsp = &protocol.MsgCompanyNoticeResponse{}
|
220
|
rsp = &protocol.MsgCompanyNoticeResponse{}
|
218
|
rsp.Total = total
|
221
|
rsp.Total = total
|
|
|
222
|
+ rsp.Lists = make([]protocol.UserMsg, 0)
|
219
|
for i := range msgBulletins {
|
223
|
for i := range msgBulletins {
|
220
|
tmp := msgBulletins[i]
|
224
|
tmp := msgBulletins[i]
|
221
|
rsp.Lists = append(rsp.Lists, protocol.UserMsg{
|
225
|
rsp.Lists = append(rsp.Lists, protocol.UserMsg{
|
|
@@ -247,6 +251,7 @@ func MsgChanceApprove(header *protocol.RequestHeader, request *protocol.MsgChanc |
|
@@ -247,6 +251,7 @@ func MsgChanceApprove(header *protocol.RequestHeader, request *protocol.MsgChanc |
247
|
return
|
251
|
return
|
248
|
}
|
252
|
}
|
249
|
rsp = &protocol.MsgChanceApproveResponse{Total: total}
|
253
|
rsp = &protocol.MsgChanceApproveResponse{Total: total}
|
|
|
254
|
+ rsp.List = make([]protocol.MsgCommonListItem, 0)
|
250
|
for i := 0; i < len(myChances); i++ {
|
255
|
for i := 0; i < len(myChances); i++ {
|
251
|
chance := myChances[i]
|
256
|
chance := myChances[i]
|
252
|
commItem := protocol.MsgCommonListItem{}
|
257
|
commItem := protocol.MsgCommonListItem{}
|
|
@@ -308,6 +313,7 @@ func MsgChanceSubmit(header *protocol.RequestHeader, request *protocol.MsgChance |
|
@@ -308,6 +313,7 @@ func MsgChanceSubmit(header *protocol.RequestHeader, request *protocol.MsgChance |
308
|
return
|
313
|
return
|
309
|
}
|
314
|
}
|
310
|
rsp = &protocol.MsgChanceSubmitResponse{Total: total}
|
315
|
rsp = &protocol.MsgChanceSubmitResponse{Total: total}
|
|
|
316
|
+ rsp.List = make([]protocol.MsgCommonListItem, 0)
|
311
|
for i := 0; i < len(myChances); i++ {
|
317
|
for i := 0; i < len(myChances); i++ {
|
312
|
chance := myChances[i]
|
318
|
chance := myChances[i]
|
313
|
commItem := protocol.MsgCommonListItem{}
|
319
|
commItem := protocol.MsgCommonListItem{}
|
|
@@ -369,6 +375,7 @@ func MsgChanceComment(header *protocol.RequestHeader, request *protocol.MsgChanc |
|
@@ -369,6 +375,7 @@ func MsgChanceComment(header *protocol.RequestHeader, request *protocol.MsgChanc |
369
|
return
|
375
|
return
|
370
|
}
|
376
|
}
|
371
|
rsp = &protocol.MsgChanceCommentResponse{Total: total}
|
377
|
rsp = &protocol.MsgChanceCommentResponse{Total: total}
|
|
|
378
|
+ rsp.List = make([]protocol.MsgCommonListItem, 0)
|
372
|
for i := 0; i < len(myChances); i++ {
|
379
|
for i := 0; i < len(myChances); i++ {
|
373
|
chance := myChances[i]
|
380
|
chance := myChances[i]
|
374
|
commItem := protocol.MsgCommonListItem{}
|
381
|
commItem := protocol.MsgCommonListItem{}
|
|
@@ -442,6 +449,7 @@ func MsgChanceThumbUp(header *protocol.RequestHeader, request *protocol.MsgChanc |
|
@@ -442,6 +449,7 @@ func MsgChanceThumbUp(header *protocol.RequestHeader, request *protocol.MsgChanc |
442
|
return
|
449
|
return
|
443
|
}
|
450
|
}
|
444
|
rsp = &protocol.MsgChanceThumbUpResponse{Total: total}
|
451
|
rsp = &protocol.MsgChanceThumbUpResponse{Total: total}
|
|
|
452
|
+ rsp.List = make([]protocol.MsgCommonListItem, 0)
|
445
|
for i := 0; i < len(myChances); i++ {
|
453
|
for i := 0; i < len(myChances); i++ {
|
446
|
chance := myChances[i]
|
454
|
chance := myChances[i]
|
447
|
commItem := protocol.MsgCommonListItem{}
|
455
|
commItem := protocol.MsgCommonListItem{}
|