Merge branch 'dev-lwl/fix' into test

This commit is contained in:
lwl0608 2024-05-06 17:56:48 +08:00
commit 42157b2ee4
2 changed files with 16 additions and 20 deletions

View File

@ -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.获取midszids并填充空间基底
@ -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)
}

View File

@ -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
}