No Description

FKProductCurrentUserItem.m 836B

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // FKProductCurrentUserItem.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/1/20.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKProductCurrentUserItem.h"
  9. @implementation FKProductCurrentUserItem
  10. + (NSDictionary *)mts_mapping{
  11. return @{
  12. @"id": mts_key(userID),
  13. @"level": mts_key(level),
  14. @"favorite": mts_key(hasCollect),
  15. @"purchased_count": mts_key(purchasedCount),
  16. @"is_buy": mts_key(hasEverBuy),
  17. };
  18. }
  19. + (BOOL)mts_shouldSetUndefinedKeys{
  20. return NO;
  21. }
  22. - (kUserLevel)getCurrentUserLevel{
  23. if ([self.level isKindOfClass:[NSString class]]) {
  24. if (self.level.integerValue == 1) return kUserLevelNoraml;
  25. if (self.level.integerValue >= 2) return kUserLevelVIP;
  26. }
  27. return kUserLevelNone;
  28. }
  29. @end