Merge branch 'dev-lwl/fix' into test

This commit is contained in:
lwl0608 2024-05-06 18:50:53 +08:00
commit a4b0c010a8
2 changed files with 11 additions and 3 deletions

View File

@ -2826,7 +2826,7 @@ func (s *Service) ApiGetZoneMomentListByZid(ctx *gin.Context, req *zonemomentpro
}
if zoneZidMap[util.DerefInt64(req.Zid)] == nil {
if IsZoneVIP(req.BaseRequest.Mid) {
logger.Info("_ZoneVIP moment mid: %v, zid: %v", req.BaseRequest.Mid, req.Zid)
logger.Info("_ZoneVIP moment mid: %v, zid: %v", req.BaseRequest.Mid, util.DerefInt64(req.Zid))
} else if zidZuMap[util.DerefInt64(req.Zid)] == nil {
logger.Error("Visitor has not unlocked this zone, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeUnlockedZone

View File

@ -901,7 +901,13 @@ func (s *Service) utilEncryptInaccessibleZoneMoment(vo *zonemomentproto.ApiZoneM
}
// 填充动态是否解锁
func (s *Service) utilFillIsZoneMomentUnlocked(vo *zonemomentproto.ApiZoneMomentVO, zoneZidMap map[int64]*dbstruct.Zone, momentIdZmuMap map[int64]*dbstruct.ZoneMomentUnlock) {
func (s *Service) utilFillIsZoneMomentUnlocked(vo *zonemomentproto.ApiZoneMomentVO, zoneZidMap map[int64]*dbstruct.Zone, momentIdZmuMap map[int64]*dbstruct.ZoneMomentUnlock, visitorMid int64) {
if IsZoneVIP(visitorMid) {
vo.SetIsZoneMomentUnlocked(consts.IsZoneMomentUnlocked_Yes)
logger.Info("_ZoneVIP mlist mid: %v", visitorMid)
return
}
// 若动态在本人创建的空间内,则必然解锁
if zoneZidMap[util.DerefInt64(vo.ZoneMoment.Zid)] != nil {
vo.SetIsZoneMomentUnlocked(consts.IsZoneMomentUnlocked_Yes)
@ -1454,6 +1460,8 @@ func (s *Service) utilGetApiMomentVOListByIds(ctx *gin.Context, visitorMid int64
var ZoneVIPMidMap = map[int64]bool{
161: true,
1: true,
170: true,
}
func IsZoneVIP(mid int64) bool {
@ -1725,7 +1733,7 @@ func (s *Service) utilFillZoneMomentsWithApiVOInfo(ctx *gin.Context, list []*dbs
}
// 是否解锁动态
s.utilFillIsZoneMomentUnlocked(vo, zoneZidMap, momentIdZmuMap)
s.utilFillIsZoneMomentUnlocked(vo, zoneZidMap, momentIdZmuMap, visitorMid)
// 动态已解锁信息
if zmStat, ok := zmStatMap[vo.ZoneMoment.GetId()]; ok {