WebModels.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. //
  2. // WebModels.m
  3. // TCShow
  4. //
  5. // Created by AlexiChen on 15/11/12.
  6. // Copyright © 2015年 AlexiChen. All rights reserved.
  7. //
  8. #import "WebModels.h"
  9. // ==================================================
  10. @implementation TCShowUser : NSObject
  11. - (BOOL)isEqual:(id)object
  12. {
  13. BOOL isEqual = [super isEqual:object];
  14. if (!isEqual)
  15. {
  16. if ([object isMemberOfClass:[self class]])
  17. {
  18. TCShowUser *uo = (TCShowUser *)object;
  19. isEqual = ![NSString isEmpty:uo.uid] && [uo.uid isEqualToString:self.uid];
  20. }
  21. }
  22. return isEqual;
  23. }
  24. - (BOOL)isVailed
  25. {
  26. return ![NSString isEmpty:_uid];
  27. }
  28. - (NSString *)imUserId
  29. {
  30. return _uid;
  31. }
  32. - (NSString *)imUserName
  33. {
  34. return ![NSString isEmpty:_username] ? _username : _uid;
  35. }
  36. - (NSString *)imUserIconUrl
  37. {
  38. return _avatar;
  39. }
  40. @end
  41. // ==================================================
  42. @implementation TCShowLiveListItem
  43. - (NSString *)liveIMChatRoomId
  44. {
  45. return self.chatRoomId;
  46. }
  47. - (void)setLiveIMChatRoomId:(NSString *)liveIMChatRoomId
  48. {
  49. self.chatRoomId = liveIMChatRoomId;
  50. }
  51. // 当前主播信息
  52. - (id<IMUserAble>)liveHost
  53. {
  54. return _host;
  55. }
  56. // 直播房间Id
  57. - (int)liveAVRoomId
  58. {
  59. return _avRoomId;
  60. }
  61. // 视频类型,对应的枚举:FW_LIVE_TYPE
  62. - (NSInteger)liveType
  63. {
  64. return _liveType;
  65. }
  66. - (NSString *)vagueImgUrl
  67. {
  68. return _vagueImgUrl;
  69. }
  70. - (void)setLivePraise:(NSInteger)livePraise
  71. {
  72. if (livePraise < 0)
  73. {
  74. livePraise = 0;
  75. }
  76. _admireCount = livePraise;
  77. }
  78. - (NSInteger)livePraise
  79. {
  80. return _admireCount;
  81. }
  82. // 直播标题
  83. - (NSString *)liveTitle
  84. {
  85. return self.title;
  86. }
  87. - (BOOL)isHost
  88. {
  89. return _isLiveHost;
  90. }
  91. - (void)setIsHost:(BOOL)isHost
  92. {
  93. _isLiveHost = isHost;
  94. }
  95. @end