YBLiveChatModel.m 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // YBLiveChatModel.m
  3. // YBVideo
  4. //
  5. // Created by YB007 on 2019/12/3.
  6. // Copyright © 2019 cat. All rights reserved.
  7. //
  8. #import "YBLiveChatModel.h"
  9. @implementation YBLiveChatModel
  10. - (instancetype)initWithDic:(NSDictionary *)dic {
  11. self = [super init];
  12. if (self) {
  13. self.titleColor = minstr([dic valueForKey:@"titleColor"]);
  14. self.userName = minstr([dic valueForKey:@"userName"]);
  15. self.contentChat = minstr([dic valueForKey:@"contentChat"]);
  16. self.userID = minstr([dic valueForKey:@"id"]);
  17. self.vip_type = minstr([dic valueForKey:@"vip_type"]);
  18. self.guard_type = minstr([dic valueForKey:@"guard_type"]);
  19. if ([minstr([dic valueForKey:@"usertype"]) isEqual:@"40"]) {
  20. self.isAdmin = @"1";
  21. }else{
  22. self.isAdmin = @"0";
  23. }
  24. self.isAnchor = minstr([dic valueForKey:@"isAnchor"]);
  25. }
  26. return self;
  27. }
  28. +(instancetype)modelWithDic:(NSDictionary *)dic {
  29. return [[self alloc]initWithDic:dic];
  30. }
  31. @end