floo2
bmx_group.h
1 //-------------------------------------------------------------------------------------------------
2 // File : bmx_group.h
3 // Author : Eric Liang <eric@bmxlabs.com>
4 // Purpose : bmx group define file.
5 // Created : 12 Nov 2018 by Eric Liang <eric@bmxlabs.com>
6 //-------------------------------------------------------------------------------------------------
7 //
8 // Copyright (C) 2018-2019 MaxIM.Top
9 //
10 // You may obtain a copy of the licence at http://www.maxim.top/LICENCE-MAXIM.md
11 //
12 //-------------------------------------------------------------------------------------------------
13 
14 #ifndef bmx_group_h__
15 #define bmx_group_h__
16 
17 #include <vector>
18 #include "bmx_base_object.h"
19 
20 namespace floo {
21 
25 class EXPORT_API BMXGroup: public BMXBaseObject {
26 public:
27 
31  struct Member {
32  Member(int64_t uid, const std::string& nickname, int64_t createTime) :
33  mUid(uid), mGroupNickname(nickname), mCreateTime(createTime) {}
34  virtual ~Member() {}
35 
36  int64_t mUid;
37  std::string mGroupNickname;
38  int64_t mCreateTime;
39  };
40  typedef std::shared_ptr<Member> MemberPtr;
41  typedef std::vector<MemberPtr> MemberList;
42 
46  struct BannedMember {
47  BannedMember() {}
48  virtual ~BannedMember() {}
49 
50  int64_t mUid;
51  std::string mGroupNickname;
52  int64_t mCreateTime;
53  int64_t mExpired;
54  };
55  typedef std::shared_ptr<BannedMember> BannedMemberPtr;
56  typedef std::vector<BannedMemberPtr> BannedMemberList;
57 
61  struct SharedFile {
62  SharedFile() {}
63  virtual ~SharedFile() {}
64 
65  int64_t mFileId;
66  int64_t mGroupId;
67  int64_t mUploader;
68  int mSize;
69  int64_t mCreateTime;
70  int64_t mUpdateTime;
71  std::string mRatelUrl; //群共享文件Ratel服务器Url
72  std::string mUrl; //群共享文件服务器Url
73  std::string mPath;
74  std::string mDisplayName;
75  std::string mType;
76  };
77  typedef std::shared_ptr<SharedFile> SharedFilePtr;
78  typedef std::vector<SharedFilePtr> SharedFileList;
79 
83  struct Announcement {
84  Announcement() {}
85  virtual ~Announcement() {}
86 
87  std::string mTitle;
88  std::string mContent;
89  int64_t mAuthor;
90  int64_t mCreateTime;
91  int64_t mId;
92  };
93  typedef std::shared_ptr<Announcement> AnnouncementPtr;
94  typedef std::vector<AnnouncementPtr> AnnouncementList;
95 
99  enum class InvitationStatus {
101  Pending,
103  Accepted,
105  Declined
106  };
107 
111  struct Invitation {
112  Invitation() {}
113  ~Invitation() {}
114 
115  int64_t mGroupId;
116  int64_t mInviterId;
117  std::string mReason;
118  InvitationStatus mStatus;
119  int64_t mExpired;
120  };
121  typedef std::shared_ptr<Invitation> InvitationPtr;
122  typedef std::vector<InvitationPtr> InvitationList;
123 
127  enum class ApplicationStatus {
129  Pending,
131  Accepted,
133  Declined
134  };
135 
139  struct Application {
140  Application() {}
141  ~Application() {}
142 
143  int64_t mGroupId;
144  int64_t mApplicationId;
145  std::string mReason;
146  ApplicationStatus mStatus;
147  int64_t mExpired;
148  };
149  typedef std::shared_ptr<Application> ApplicationPtr;
150  typedef std::vector<ApplicationPtr> ApplicationList;
151 
155  enum class MsgPushMode {
157  All,
159  None,
161  AdminOrAt,
163  Admin,
165  At
166  };
167 
171  enum class ModifyMode {
173  AdminOnly,
175  Open,
176  };
177 
181  enum class JoinAuthMode {
183  Open,
185  NeedApproval,
187  RejectAll
188  };
189 
193  enum class InviteMode {
195  AdminOnly,
197  Open
198  };
199 
203  enum class UpdateInfoType {
205  UnKnown,
207  Name,
209  Description,
211  Avatar,
213  Owner,
215  Ext,
217  NickName,
219  ModifyMode,
221  JoinAuthMode,
223  InviteMode,
225  MsgPushMode,
227  MsgMuteMode,
229  ReadAckMode,
231  HistoryVisibleMode
232  };
233 
237  enum class GroupStatus {
239  Normal,
241  Destroyed,
242  };
243 
247  enum class MsgMuteMode {
249  None,
251  MuteNotification,
253  MuteChat
254  };
255 
256  enum class MemberRoleType {
258  GroupMember,
260  GroupAdmin,
262  GroupOwner,
264  NotGroupMember
265  };
266 
267  enum class GroupType {
269  Private,
271  Public,
273  Chatroom
274  };
275 
279  virtual ~BMXGroup() {}
280 
285  virtual int64_t groupId() = 0;
286 
291  virtual GroupType groupType() = 0;
292 
297  virtual const std::string& myNickname() = 0;
298 
303  virtual const std::string& name() = 0;
304 
309  virtual const std::string& description() = 0;
310 
315  virtual std::string avatarRatelUrl() = 0;
316 
321  virtual std::string avatarUrl() = 0;
322 
327  virtual std::string avatarPath() = 0;
328 
333  virtual std::string avatarThumbnailUrl() = 0;
334 
339  virtual std::string avatarThumbnailPath() = 0;
340 
345  virtual int64_t createTime() = 0;
346 
351  virtual const JSON& extension() = 0;
352 
357  virtual int64_t ownerId() = 0;
358 
363  virtual int capacity() = 0;
364 
369  virtual int membersCount() = 0;
370 
375  virtual int adminsCount() = 0;
376 
381  virtual int blockListSize() = 0;
382 
387  virtual int bannedListSize() = 0;
388 
393  virtual int sharedFilesCount() = 0;
394 
399  virtual int64_t latestAnnouncementId() = 0;
400 
405  virtual MsgPushMode msgPushMode() = 0;
406 
411  virtual ModifyMode modifyMode() = 0;
412 
417  virtual JoinAuthMode joinAuthMode() = 0;
418 
423  virtual InviteMode inviteMode() = 0;
424 
429  virtual MsgMuteMode msgMuteMode() = 0;
430 
435  virtual GroupStatus groupStatus() = 0;
436 
442  virtual bool isMember() = 0;
443 
448  virtual bool enableReadAck() = 0;
449 
454  virtual bool historyVisible() = 0;
455 
460  virtual MemberRoleType roleType() = 0;
461 
462 protected:
463  BMXGroup() {}
464 
465 private:
466  BMXGroup(const BMXGroup&);
467  BMXGroup& operator=(const BMXGroup&);
468 };
469 
470 typedef std::shared_ptr<BMXGroup> BMXGroupPtr;
471 typedef std::vector<BMXGroupPtr> BMXGroupList;
472 
473 }
474 
475 #endif /* bmx_group_h__ */
群申请
Definition: bmx_group.h:139
群邀请
Definition: bmx_group.h:111
GroupType
Definition: bmx_group.h:267
virtual ~BMXGroup()
析构函数
Definition: bmx_group.h:279
InvitationStatus
群邀请状态
Definition: bmx_group.h:99
MsgMuteMode
群组消息屏蔽模式
Definition: bmx_group.h:247
群禁言成员
Definition: bmx_group.h:46
InviteMode
邀请入群模式
Definition: bmx_group.h:193
ApplicationStatus
群申请状态
Definition: bmx_group.h:127
MemberRoleType
Definition: bmx_group.h:256
GroupStatus
群组状态
Definition: bmx_group.h:237
群成员
Definition: bmx_group.h:31
UpdateInfoType
群组信息更新类型
Definition: bmx_group.h:203
ModifyMode
群信息修改模式
Definition: bmx_group.h:171
JoinAuthMode
进群验证方式
Definition: bmx_group.h:181
群公告
Definition: bmx_group.h:83
MsgPushMode
消息通知类型
Definition: bmx_group.h:155
Definition: bmx_base_object.h:26
群共享文件
Definition: bmx_group.h:61
群组
Definition: bmx_group.h:25