JXUserBaseObj.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. //
  2. // JXUserBaseObj.h
  3. // shiku_im
  4. //
  5. // Created by flyeagleTang on 14-5-31.
  6. // Copyright (c) 2014年 Reese. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #define membershipAccount_ID @"membershipAccount"
  10. #define kUSER_ID @"userId"
  11. #define kROOM_ID @"roomId"
  12. #define kUSER_NICKNAME @"userNickname"
  13. #define kUSER_REMARKNAME @"remarkName"
  14. #define kUSER_DESCRIBE @"describe"
  15. #define kUSER_ROLE @"role"
  16. #define kUSER_CREATEUSER_ID @"createUserId"
  17. #define kUSER_DESCRIPTION @"userDescription"
  18. #define kUSER_USERHEAD @"userHead"
  19. #define kUSER_ROOM_FLAG @"roomFlag"
  20. #define kUSER_ROOM_CATEGORY @"category"
  21. #define kUSER_NEW_MSGS @"newMsgs"
  22. #define kUSER_TIME_CREATE @"timeCreate"
  23. #define kUSER_TIME_SEND @"timeSend"
  24. #define kUSER_DownloadTime @"downloadTime"
  25. #define kUSER_CHATRECORDTIMEOUT @"chatRecordTimeOut"
  26. #define kUSER_TALKTIME @"talkTime"
  27. #define kUSER_STATUS @"status"
  28. #define kUSER_USERTYPE @"userType"
  29. #define kUSER_TYPE @"type"
  30. #define kUSER_COMPANY_ID @"companyId"
  31. #define kUSER_CONTENT @"content"
  32. #define kUSER_isMySend @"isMySend"
  33. #define kUSER_lastInput @"lastInput"
  34. #define kUSER_CALL @"call"
  35. #define kUSER_showRead @"showRead"
  36. #define kUSER_showMember @"showMember"
  37. #define kUSER_allowSendCard @"allowSendCard"
  38. #define kUSER_allowInviteFriend @"allowInviteFriend"
  39. #define kUSER_allowUploadFile @"allowUploadFile"
  40. #define kUSER_allowConference @"allowConference"
  41. #define kUSER_allowSpeakCourse @"allowSpeakCourse"
  42. #define kUSER_isNeedVerify @"isNeedVerify"
  43. #define kUSER_TOPTIME @"topTime"
  44. #define kUSER_GROUPSTATUS @"groupStatus"
  45. #define kUSER_isOnLine @"isOnLine"
  46. #define kUSER_isOpenReadDel @"isOpenReadDel"
  47. #define kUSER_offlineNoPushMsg @"offlineNoPushMsg"
  48. #define kUSER_isAtMe @"isAtMe"
  49. #define kUSER_isSendRecipt @"isSendRecipt"
  50. #define kUSER_isDevice @"isDevice"
  51. #define kUSER_joinTime @"joinTime"
  52. #define kUSER_publicKeyDH @"publicKeyDH"
  53. #define kUSER_publicKeyRSARoom @"publicKeyRSARoom"
  54. #define kUSER_chatKeyGroup @"chatKeyGroup"
  55. #define kUSER_groupType @"groupType"
  56. @interface JXUserBaseObj : NSObject{
  57. NSString* _tableName;
  58. }
  59. #define friend_status_hisAddFriend -4// 他添加我为好友
  60. #define friend_status_addFriend -3// 我添加他为好友
  61. #define friend_status_hisBlack -2//他拉黑我
  62. #define friend_status_black -1//我拉黑他
  63. #define friend_status_none 0 //陌生人
  64. #define friend_status_see 1 //单方关注
  65. #define friend_status_friend 2 //互为好友
  66. #define friend_status_white 7 //白名单
  67. #define friend_status_system 8 //系统号
  68. #define friend_status_hide 9 //非显示系统号
  69. @property (nonatomic,strong) NSString* membershipAccount;//房间时,等于roomJid
  70. @property (nonatomic,strong) NSString* userId;//房间时,等于roomJid
  71. @property (nonatomic,strong) NSString* roomId;//接口的roomId
  72. @property (nonatomic,strong) NSString* userNickname;
  73. @property (nonatomic,strong) NSString* remarkName; // 备注
  74. @property (nonatomic,strong) NSString *describe; // 描述
  75. @property (nonatomic,strong) NSString *telephone; // 电话号码
  76. @property (nonatomic,strong) NSString *bubbleFontId; // 气泡id
  77. @property (nonatomic,strong) NSString *gradeIndex; // VIP等级
  78. @property (nonatomic,strong) NSString *groupType; // 群类型
  79. @property (nonatomic, assign) int chatType; // 聊天类型
  80. @property (nonatomic,strong) NSString* createUserId; // 创建者userId
  81. @property (nonatomic,strong) NSArray* role; // 身份 1=游客(用于后台浏览数据);2=公众号 ;3=机器账号,由系统自动生成;4=客服账号;5=管理员;6=超级管理员;7=财务;
  82. @property (nonatomic,strong) NSString* userDescription;
  83. @property (nonatomic,strong) NSString* userHead;
  84. @property (nonatomic,strong) NSNumber* type;
  85. @property (nonatomic,strong) NSString* content;
  86. @property (nonatomic,strong) NSDate* timeSend;
  87. @property (nonatomic,strong) NSDate* downloadTime;
  88. @property (nonatomic,strong) NSString* chatRecordTimeOut; // 消息保留天数
  89. @property (nonatomic,strong) NSString *groupChatSyncTimeLen; // 群聊聊天记录 同步时长
  90. @property (nonatomic,strong) NSNumber* talkTime; // 群组全员禁言时间
  91. @property (nonatomic,strong) NSDate* timeCreate;
  92. @property (nonatomic,strong) NSNumber* roomFlag;//0:朋友;1:永久房间;2:临时房间
  93. @property (nonatomic,strong) NSNumber* msgsNew; // 新消息数量
  94. @property (nonatomic,strong) NSNumber* status;//-1://黑名单;0:陌生人;1:单方关注;2:互为好友;8:系统号;9:非显示系统号 10:本账号的其他端
  95. @property (nonatomic,strong) NSNumber* userType;// 2 :公众号
  96. @property (nonatomic,strong) NSNumber* companyId;
  97. @property (nonatomic,strong) NSNumber* isMySend;
  98. @property (nonatomic,strong) NSNumber* showRead;//显示已读模式
  99. @property (nonatomic,strong) NSNumber* showMember;//显示群成员列表
  100. @property (nonatomic,strong) NSNumber* allowSendCard;//允许发送名片
  101. @property (nonatomic,strong) NSNumber* maxCount;// 最大群人数
  102. @property (nonatomic, strong) NSNumber* allowInviteFriend; // 允许普通成员邀请好友,1:允许 0:不允许 默认允许
  103. @property (nonatomic, strong) NSNumber* allowUploadFile; // 允许群成员上传群共享文件,1:允许 0:不允许 默认允许
  104. @property (nonatomic, strong) NSNumber* allowConference; // 允许成员召开会议,1:允许 0:不允许 默认允许
  105. @property (nonatomic, strong) NSNumber* allowSpeakCourse; // 允许群成员发起讲课,1:允许 0:不允许 默认允许
  106. @property (nonatomic, strong) NSNumber* isNeedVerify; // 群组邀请确认
  107. @property (nonatomic,strong) NSDate* topTime; // 置顶时间
  108. @property (nonatomic, strong) NSString *lastInput; //记录输入框中最后输入的字符串,下次进入自动填入
  109. @property (nonatomic, strong) NSNumber *groupStatus; //0:正常 1:被踢出 2:房间被删除
  110. @property (nonatomic, strong) NSNumber *isupdate; // 是否同步好友
  111. @property (nonatomic,strong) NSNumber* isOpenReadDel;// 是否开启阅后即焚
  112. @property (nonatomic,strong) NSNumber* offlineNoPushMsg;// 是否消息免打扰
  113. @property (nonatomic,strong) NSNumber* isAtMe;// 群组里面是否有@我的消息
  114. // isOnLine isSendRecipt isDevice 只用于多点登录,本账号的其他设备user
  115. @property (nonatomic, strong) NSNumber *isOnLine;
  116. @property (nonatomic, strong) NSNumber *isSendRecipt;
  117. @property (nonatomic, strong) NSNumber *isDevice;
  118. @property (nonatomic, strong) NSNumber *category; // 群组类型 510:手机联系人群组
  119. @property (nonatomic,strong) NSDate* joinTime; // 群组分页获取群成员,最后一个成员加入时间
  120. @property (nonatomic, copy) NSString *publicKeyDH; //好友对称秘钥DH
  121. @property (nonatomic, copy) NSString *publicKeyRSARoom; //群组RSA公钥
  122. @property (nonatomic, copy) NSString *chatKeyGroup; // 群组消息秘钥
  123. @property (nonatomic, strong) NSNumber *veryCare; //特别关心
  124. @property (nonatomic, strong) NSNumber *veryCareTones;
  125. //数据库增删改查
  126. -(BOOL)insert;
  127. -(BOOL)delete;
  128. -(BOOL)update;
  129. -(BOOL)reset;
  130. +(JXUserBaseObj*)sharedInstance;
  131. //将对象转换为字典
  132. -(BOOL)haveTheUser;
  133. -(NSDictionary*)toDictionary;
  134. -(void)userFromDataset:(JXUserBaseObj*)obj rs:(FMResultSet*)rs;
  135. -(void)userFromDictionary:(JXUserBaseObj*)obj dict:(NSDictionary*)aDic;
  136. -(BOOL)checkTableCreatedInDb:(FMDatabase *)db;
  137. -(NSString*)doSendMsg:(int)aType content:(NSString*)aContent;
  138. -(void)loadFromObject:(JXUserBaseObj*)user;
  139. -(void)notifyDelFriend;
  140. -(void)notifyNewFriend;
  141. // 更新等级和气泡
  142. -(BOOL)updateBubbleFontIdAndGradIndex;
  143. @end