正在显示
3 个修改的文件
包含
18 行增加
和
2 行删除
@@ -332,7 +332,7 @@ type ChanceDetailRequest struct { | @@ -332,7 +332,7 @@ type ChanceDetailRequest struct { | ||
332 | } | 332 | } |
333 | type ChanceDetailResponse struct { | 333 | type ChanceDetailResponse struct { |
334 | ChanceDetail ChanceItem `json:"chance"` | 334 | ChanceDetail ChanceItem `json:"chance"` |
335 | - ChanceData interface{} `json:"chanceData,omitempty"` //机会数据(是否收藏/点赞 浏览数 点赞总数 评论数)ChanceData | 335 | + StatisticData interface{} `json:"statisticData"` //机会数据(是否收藏/点赞 浏览数 点赞总数 评论数)ChanceData |
336 | ApproveData *ApproveData `json:"approveData"` | 336 | ApproveData *ApproveData `json:"approveData"` |
337 | ApproveProcess []*ProcessItem `json:"approveProcess"` | 337 | ApproveProcess []*ProcessItem `json:"approveProcess"` |
338 | ApproveAccess *ApproveAccess `json:"approveAccess"` // | 338 | ApproveAccess *ApproveAccess `json:"approveAccess"` // |
@@ -185,7 +185,7 @@ func GetChanceMarkData(userId, companyId int64, sourceId int64) (flag int, err e | @@ -185,7 +185,7 @@ func GetChanceMarkData(userId, companyId int64, sourceId int64) (flag int, err e | ||
185 | ) | 185 | ) |
186 | if v, err = models.GetChanceFavorite(userId, companyId, sourceId, protocol.SourceTypeChance); err != nil { | 186 | if v, err = models.GetChanceFavorite(userId, companyId, sourceId, protocol.SourceTypeChance); err != nil { |
187 | if err == orm.ErrNoRows { | 187 | if err == orm.ErrNoRows { |
188 | - log.Error(userId, companyId, sourceId, err) | 188 | + //log.Error(userId, companyId, sourceId, err) |
189 | return 0, nil | 189 | return 0, nil |
190 | } | 190 | } |
191 | return | 191 | return |
@@ -1388,6 +1388,22 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail | @@ -1388,6 +1388,22 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail | ||
1388 | rsp.ApproveProcess = approveProcess.ApproveProcess | 1388 | rsp.ApproveProcess = approveProcess.ApproveProcess |
1389 | rsp.ApproveAccess = approveProcess.ApproveAccess | 1389 | rsp.ApproveAccess = approveProcess.ApproveAccess |
1390 | } | 1390 | } |
1391 | + | ||
1392 | + { | ||
1393 | + var flag int | ||
1394 | + var chanceData = protocol.ChanceData{ | ||
1395 | + ThumbsUpTotal: chance.ZanTotal, | ||
1396 | + CommentTotal: chance.CommentTotal, | ||
1397 | + PageViewTotal: chance.ViewTotal, | ||
1398 | + } | ||
1399 | + if flag, err = agg.GetChanceMarkData(header.UserId, header.CompanyId, chance.Id); err != nil { | ||
1400 | + log.Error(err) | ||
1401 | + return | ||
1402 | + } | ||
1403 | + chanceData.IsThumbsUp = (flag & protocol.MarkFlagZan) == protocol.MarkFlagZan | ||
1404 | + chanceData.IsCollect = (flag & protocol.MarkFlagCollect) == protocol.MarkFlagCollect | ||
1405 | + rsp.StatisticData = chanceData | ||
1406 | + } | ||
1391 | return | 1407 | return |
1392 | } | 1408 | } |
1393 | 1409 |
-
请 注册 或 登录 后发表评论