vip.go 450 B

12345678910111213141516171819
  1. package api
  2. const (
  3. _normalVip = 1 //月度大会员
  4. _annualVip = 2 //年度会员
  5. _statusAvailable = 1 //未过期
  6. _statusFrozen = 2 //冻结
  7. )
  8. // IsValid decide the user is valid vip or not.
  9. func (v *VipInfo) IsValid() bool {
  10. return v.Status == _statusAvailable && (v.Type == _normalVip || v.Type == _annualVip)
  11. }
  12. // IsFrozen decide the user is frozen vip or not.
  13. func (v *VipInfo) IsFrozen() bool {
  14. return v.Status == _statusFrozen
  15. }