YBGiftModel.m 945 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // YBGiftModel.m
  3. // YBVideo
  4. //
  5. // Created by YB007 on 2019/8/20.
  6. // Copyright © 2019 cat. All rights reserved.
  7. //
  8. #import "YBGiftModel.h"
  9. @implementation YBGiftModel
  10. - (instancetype)initWithDic:(NSDictionary *)dic
  11. {
  12. self = [super init];
  13. if (self) {
  14. _idStr = minstr([dic valueForKey:@"id"]);
  15. _typeStr = minstr([dic valueForKey:@"type"]);
  16. _markStr = minstr([dic valueForKey:@"mark"]);
  17. _giftNameStr = minstr([dic valueForKey:@"giftname"]);
  18. _needCoinStr = minstr([dic valueForKey:@"needcoin"]);
  19. _needCoinNameStr = minstr([dic valueForKey:@"needcoin_name"]);
  20. _giftIconStr = minstr([dic valueForKey:@"gifticon"]);
  21. _nums = @"0";
  22. if ([dic valueForKey:@"nums"]) {
  23. _nums = minstr([dic valueForKey:@"nums"]);
  24. }
  25. }
  26. return self;
  27. }
  28. +(instancetype)modelWithDic:(NSDictionary *)dic;{
  29. return [[self alloc]initWithDic:dic];
  30. }
  31. @end