MsgTopPubModel.m 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // MsgTopPubModel.m
  3. // YBVideo
  4. //
  5. // Created by YunBao on 2018/7/24.
  6. // Copyright © 2018年 cat. All rights reserved.
  7. //
  8. #import "MsgTopPubModel.h"
  9. @implementation MsgTopPubModel
  10. - (instancetype)initWithDic:(NSDictionary *)dic vcType:(NSString *)vcType{
  11. self = [super init];
  12. if (self) {
  13. _pageVC = vcType;
  14. _uidStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"uid"]];
  15. _unameStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"user_nickname"]];
  16. _iconStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"avatar"]];
  17. _timeStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"addtime"]];
  18. _videoidStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"videoid"]];
  19. _videouidStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"videouid"]];
  20. _coverStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"video_thumb"]];
  21. //赞
  22. if ([_pageVC isEqual:@"赞"]) {
  23. _typeStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"type"]];
  24. _commentid = [NSString stringWithFormat:@"%@",[dic valueForKey:@"obj_id"]];
  25. }else if ([_pageVC isEqual:@"@我的"]){
  26. _typeStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"type"]];
  27. _videoTitleStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"video_title"]];
  28. }else{
  29. //评论
  30. _touidStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"touid"]];
  31. _commentConStr = [NSString stringWithFormat:@"%@",[dic valueForKey:@"content"]];
  32. }
  33. }
  34. return self;
  35. }
  36. +(instancetype)modelWithDic:(NSDictionary *)dic vcType:(NSString *)vcType{
  37. return [[self alloc]initWithDic:dic vcType:vcType];
  38. }
  39. @end