67 lines
1.5 KiB
Objective-C
67 lines
1.5 KiB
Objective-C
//
|
|
// YMGiftInfoModel.m
|
|
// YUMI
|
|
//
|
|
// Created by YUMI on 2021/11/11.
|
|
//
|
|
|
|
#import "GiftInfoModel.h"
|
|
#import "MJExtension.h"
|
|
|
|
@implementation GiftInfoModel
|
|
MJCodingImplementation
|
|
|
|
- (BOOL)isEqual:(id)other
|
|
{
|
|
if (other == self) {
|
|
return YES;
|
|
}
|
|
|
|
if (![other isKindOfClass:[GiftInfoModel class]]) {
|
|
return NO;
|
|
}
|
|
|
|
if ([(GiftInfoModel *)other giftId] == self.giftId) {
|
|
return YES;
|
|
} else {
|
|
return NO;
|
|
}
|
|
}
|
|
|
|
- (NSUInteger)hash
|
|
{
|
|
return [@(self.giftId) hash];
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation GiftPanelTabModel
|
|
MJCodingImplementation
|
|
|
|
- (GiftType)tabGiftType {
|
|
if ([self.key isEqualToString:@"normalGift"]) {
|
|
return GiftType_Game;
|
|
} else if ([self.key isEqualToString:@"luckyBagGift"]) {
|
|
return GiftType_Lucky;
|
|
} else if ([self.key isEqualToString:@"superLuckyGift"]) {
|
|
return GiftType_super;
|
|
} else if ([self.key isEqualToString:@"vipGift"]) {
|
|
return GiftType_Noble;
|
|
} else if ([self.key isEqualToString:@"countryGift"]) {
|
|
return GiftType_Country;
|
|
} else if ([self.key isEqualToString:@"weekStarGift"]) {
|
|
return GiftType_WeekStar;
|
|
} else if ([self.key isEqualToString:@"singlePopularGift"]) {
|
|
return GiftType_Anchor;
|
|
} else if ([self.key isEqualToString:@"customGift"]) {
|
|
return GiftType_Custom;
|
|
} else if ([self.key isEqualToString:@"cpGift"]) {
|
|
return GiftType_CP;
|
|
} else if ([self.key isEqualToString:@"bravoGift"]) {
|
|
return GiftType_Bravo;
|
|
}
|
|
|
|
return GiftType_Game;
|
|
}
|
|
@end
|