...
|
...
|
@@ -10,14 +10,14 @@ import ( |
|
|
func Commend(header *protocol.RequestHeader, request *protocol.CommendRequest) (rsp *protocol.CommendResponse, err error) {
|
|
|
var (
|
|
|
userBaseInfo *protocol.UserBaseInfoAggregation
|
|
|
user *models.User
|
|
|
commends []*models.Commend
|
|
|
//user *models.User
|
|
|
commends []*models.Commend
|
|
|
)
|
|
|
rsp = &protocol.CommendResponse{}
|
|
|
user, err = models.GetUsersById(header.Uid)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
//user, err = models.GetUsersById(header.Uid)
|
|
|
//if err != nil {
|
|
|
// return
|
|
|
//}
|
|
|
if commends, rsp.Total, err = models.GetCommends(header.CompanyId, request.LastId, request.PageSize); err != nil {
|
|
|
return
|
|
|
}
|
...
|
...
|
@@ -27,18 +27,13 @@ func Commend(header *protocol.RequestHeader, request *protocol.CommendRequest) ( |
|
|
if err != nil {
|
|
|
continue
|
|
|
}
|
|
|
user = userBaseInfo.User
|
|
|
//user = userBaseInfo.User
|
|
|
cInfo := protocol.CommendInfo{
|
|
|
Id: c.Id,
|
|
|
Content: c.Content,
|
|
|
Company: userBaseInfo.Company.Name,
|
|
|
CommendAt: time.GetUnixTimeByNDayUnix(c.CommendAt.Unix(), 0),
|
|
|
Honored: protocol.BaseUserInfo{
|
|
|
UserId: c.UserId,
|
|
|
NickName: user.NickName,
|
|
|
Department: agg.GetTopDepartment(userBaseInfo.Department).Name,
|
|
|
Position: agg.GetTopPosition(userBaseInfo.Position).Name,
|
|
|
},
|
|
|
Honored: agg.SetBaseInfoFrom(userBaseInfo),
|
|
|
}
|
|
|
rsp.Lists = append(rsp.Lists, cInfo)
|
|
|
}
|
...
|
...
|
|