diff --git a/app/mix/service/utilservice.go b/app/mix/service/utilservice.go index 0888aff1..59143090 100644 --- a/app/mix/service/utilservice.go +++ b/app/mix/service/utilservice.go @@ -1452,6 +1452,14 @@ func (s *Service) utilGetApiMomentVOListByIds(ctx *gin.Context, visitorMid int64 return } +var ZoneVIPMidMap = map[int64]bool{ + 161: true, +} + +func IsZoneVIP(mid int64) bool { + return ZoneVIPMidMap[mid] +} + func (s *Service) utilFillZonesWithApiVOInfo(ctx *gin.Context, list []*dbstruct.Zone, visitorMid int64, zidZuMap map[int64]*dbstruct.ZoneUnlock) (volist []*zoneproto.ApiZoneVO, err error) { // 1.获取mids,zids,并填充空间基底 @@ -1582,6 +1590,14 @@ func (s *Service) utilFillZonesWithApiVOInfo(ctx *gin.Context, list []*dbstruct. vo.IsSuperfanshipUnlocked = consts.IsSuperfanshipUnlocked_No } + // 空间vip 白名单 直接给看 + if IsZoneVIP(visitorMid) { + logger.Info("_ZoneVIP mid: %v, zid: %v", visitorMid, zid) + vo.VisitorRole = consts.Zone_Visitor + vo.IsIronfanshipUnlocked = consts.IsIronfanshipUnlocked_Yes + vo.IsSuperfanshipUnlocked = consts.IsSuperfanshipUnlocked_Yes + } + if zv, ok := zvMap[zid]; ok { vo.CopyZoneVas(zv) } diff --git a/dbstruct/vas_mysql.go b/dbstruct/vas_mysql.go index e7bfac35..984d8626 100644 --- a/dbstruct/vas_mysql.go +++ b/dbstruct/vas_mysql.go @@ -23,14 +23,6 @@ var OrderStatusDescMap = map[int32]string{ VasOrderStatusRefund: "已退款", } -var ZoneVIPMidMap = map[int64]bool{ - 161: true, -} - -func IsVIP(mid int64) bool { - return ZoneVIPMidMap[mid] -} - // 现金订单 type Order struct { ID *string `json:"id" db:"id"` // 订单id @@ -987,9 +979,6 @@ type ZoneUnlock struct { } func (p *ZoneUnlock) IsUnlockAdmission() bool { - if IsVIP(p.GetMid()) { - return true - } if ValidZoneUnlockType[p.GetAdmissionUnlockType()] && (p.GetAdmissionUntil() == -1 || p.GetAdmissionUntil() >= time.Now().Unix()) { return true @@ -998,9 +987,6 @@ func (p *ZoneUnlock) IsUnlockAdmission() bool { } func (p *ZoneUnlock) IsUnlockIronfanship() bool { - if IsVIP(p.GetMid()) { - return true - } if ValidZoneUnlockType[p.GetIronfanshipUnlockType()] && p.IsUnlockAdmission() && (p.GetIronfanshipUntil() == -1 || p.GetIronfanshipUntil() >= time.Now().Unix()) { return true @@ -1009,9 +995,6 @@ func (p *ZoneUnlock) IsUnlockIronfanship() bool { } func (p *ZoneUnlock) IsUnlockSuperfanship() bool { - if IsVIP(p.GetMid()) { - return true - } if ValidZoneUnlockType[p.GetSuperfanshipUnlockType()] && p.IsUnlockAdmission() && (p.GetSuperfanshipUntil() == -1 || p.GetSuperfanshipUntil() >= time.Now().Unix()) { return true @@ -1266,9 +1249,6 @@ type ZoneMomentUnlock struct { } func (p *ZoneMomentUnlock) IsUnlock() bool { - if IsVIP(p.GetMid()) { - return true - } if p.GetStatus() == ZoneMomentUnlockStatusUnlock { return true }