Go to the documentation of this file.
7 #ifndef _NIM_SDK_CPP_SUPERTEAM_HELPER_H_
8 #define _NIM_SDK_CPP_SUPERTEAM_HELPER_H_
16 #include "nim_define_include.h"
26 SuperTeamInfo(
const std::string& team_id) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyID] = team_id; }
37 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyName))
39 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyCreator))
41 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyLevel))
42 SetLevel(new_info.GetLevel());
43 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyProperty))
45 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyIntro))
47 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyAnnouncement))
49 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyJoinMode))
54 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyCustom))
56 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyIcon))
58 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyBeInviteMode))
60 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyInviteMode))
62 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyUpdateInfoMode))
64 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyUpdateCustomMode))
66 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyID))
68 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyValidFlag))
70 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyMemberValid))
72 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyMemberCount))
74 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyListTime))
76 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyCreateTime))
78 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyUpdateTime))
80 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyServerCustom))
82 if (new_info.
ExistValue(kNIMSuperTeamInfoKeyMuteAll) || new_info.
ExistValue(kNIMSuperTeamInfoKeyMuteType))
88 void SetSuperTeamID(
const std::string&
id) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyID] = id; }
91 std::string
GetSuperTeamID()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyID].asString(); }
94 void SetName(
const std::string& name) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyName] = name; }
97 std::string
GetName()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyName].asString(); }
100 void SetOwnerID(
const std::string&
id) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyCreator] = id; }
103 std::string
GetOwnerID()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyCreator].asString(); }
106 team_info_json_value_[nim::kNIMSuperTeamInfoKeyMemberMaxCount] = count;
107 team_info_json_value_[nim::kNIMSuperTeamInfoKeyLevel] = count;
111 int GetMemberMaxCount()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyMemberMaxCount].asUInt(); }
113 void SetProperty(
const std::string& prop) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyProperty] = prop; }
116 std::string
GetProperty()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyProperty].asString(); }
119 void SetValid(
bool valid) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyValidFlag] = valid ? 1 : 0; }
122 bool IsValid()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyValidFlag].asUInt() == 1; }
125 void SetMemberCount(
int count) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyMemberCount] = count; }
128 int GetMemberCount()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyMemberCount].asUInt(); }
131 void SetMemberListTimetag(int64_t timetag) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyListTime] = timetag; }
134 int64_t
GetMemberListTimetag()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyListTime].asUInt64(); }
137 void SetCreateTimetag(int64_t timetag) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyCreateTime] = timetag; }
140 int64_t
GetCreateTimetag()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyCreateTime].asUInt64(); }
143 void SetUpdateTimetag(int64_t timetag) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyUpdateTime] = timetag; }
146 int64_t
GetUpdateTimetag()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyUpdateTime].asUInt64(); }
149 void SetMemberValid(
bool valid) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyMemberValid] = valid ? 1 : 0; }
152 bool IsMemberValid()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyMemberValid].asUInt() == 1; }
155 void SetIntro(
const std::string& intro) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyIntro] = intro; }
158 std::string
GetIntro()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyIntro].asString(); }
161 void SetAnnouncement(
const std::string& announcement) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyAnnouncement] = announcement; }
164 std::string
GetAnnouncement()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyAnnouncement].asString(); }
167 void SetJoinMode(nim::NIMSuperTeamJoinMode mode) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyJoinMode] = mode; }
170 nim::NIMSuperTeamJoinMode
GetJoinMode()
const {
return (NIMSuperTeamJoinMode)team_info_json_value_[nim::kNIMSuperTeamInfoKeyJoinMode].asUInt(); }
173 void SetCustom(
const std::string& custom) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyCustom] = custom; }
176 std::string
GetCustom()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyCustom].asString(); }
179 void SetServerCustom(
const std::string& custom) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyServerCustom] = custom; }
182 std::string
GetServerCustom()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyServerCustom].asString(); }
185 void SetIcon(
const std::string& icon) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyIcon] = icon; }
188 std::string
GetIcon()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyIcon].asString(); }
191 void SetBeInviteMode(
int be_invite_mode) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyBeInviteMode] = be_invite_mode; }
194 int GetBeInviteMode()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyBeInviteMode].asUInt(); }
197 void SetInviteMode(NIMSuperTeamInviteMode mode) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyInviteMode] = mode; }
201 return (NIMSuperTeamInviteMode)team_info_json_value_[nim::kNIMSuperTeamInfoKeyInviteMode].asUInt();
205 void SetUpdateInfoMode(NIMSuperTeamUpdateInfoMode mode) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyUpdateInfoMode] = mode; }
209 return (NIMSuperTeamUpdateInfoMode)team_info_json_value_[nim::kNIMSuperTeamInfoKeyUpdateInfoMode].asUInt();
213 void SetUpdateCustomMode(NIMSuperTeamUpdateCustomMode mode) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyUpdateCustomMode] = mode; }
217 return (NIMSuperTeamUpdateCustomMode)team_info_json_value_[nim::kNIMSuperTeamInfoKeyUpdateCustomMode].asUInt();
220 void SetMute(NIMSuperTeamMuteType mute_type) { team_info_json_value_[nim::kNIMTeamInfoKeyMuteType] = mute_type; }
224 if (team_info_json_value_.isMember(nim::kNIMSuperTeamInfoKeyMuteAll) &&
225 team_info_json_value_[nim::kNIMSuperTeamInfoKeyMuteType].asUInt() == 1)
226 return kNIMSuperTeamMuteTypeNomalMute;
227 return (NIMSuperTeamMuteType)team_info_json_value_[nim::kNIMSuperTeamInfoKeyMuteType].asUInt();
235 bool ExistValue(
const std::string& nim_team_info_key)
const {
return team_info_json_value_.isMember(nim_team_info_key); }
241 std::string
ToJsonString()
const {
return GetJsonStringWithNoStyled(team_info_json_value_); }
247 nim_cpp_wrapper_util::Json::Value
ToJsonValue()
const {
return team_info_json_value_; }
251 void SetLevel(
int level) { team_info_json_value_[nim::kNIMSuperTeamInfoKeyLevel] = level; }
254 int GetLevel()
const {
return team_info_json_value_[nim::kNIMSuperTeamInfoKeyLevel].asUInt(); }
257 nim_cpp_wrapper_util::Json::Value team_info_json_value_;
265 member_info_json_value_[kNIMSuperTeamUserKeyID] = team_id;
266 member_info_json_value_[kNIMSuperTeamUserKeyAccID] = accid;
267 member_info_json_value_[kNIMSuperTeamUserKeyType] = type;
275 void SetSuperTeamID(
const std::string&
id) { member_info_json_value_[kNIMSuperTeamUserKeyID] = id; }
278 std::string
GetSuperTeamID()
const {
return member_info_json_value_[kNIMSuperTeamUserKeyID].asString(); }
281 void SetAccountID(
const std::string&
id) { member_info_json_value_[kNIMSuperTeamUserKeyAccID] = id; }
284 std::string
GetAccountID()
const {
return member_info_json_value_[kNIMSuperTeamUserKeyAccID].asString(); }
287 void SetUserType(nim::NIMSuperTeamUserType type) { member_info_json_value_[kNIMSuperTeamUserKeyType] = type; }
290 nim::NIMSuperTeamUserType
GetUserType()
const {
return (nim::NIMSuperTeamUserType)member_info_json_value_[kNIMSuperTeamUserKeyType].asUInt(); }
293 void SetNick(
const std::string& nick) { member_info_json_value_[kNIMSuperTeamUserKeyNick] = nick; }
296 std::string
GetNick()
const {
return member_info_json_value_[kNIMSuperTeamUserKeyNick].asString(); }
299 void SetBits(int64_t bit) { member_info_json_value_[kNIMSuperTeamUserKeyBits] = bit; }
302 int64_t
GetBits()
const {
return member_info_json_value_[kNIMSuperTeamUserKeyBits].asUInt64(); }
305 void SetValid(
bool valid) { member_info_json_value_[kNIMSuperTeamUserKeyValidFlag] = valid ? 1 : 0; }
308 bool IsValid()
const {
return member_info_json_value_[kNIMSuperTeamUserKeyValidFlag].asUInt() == 1; }
311 void SetCreateTimetag(int64_t timetag) { member_info_json_value_[kNIMSuperTeamUserKeyCreateTime] = timetag; }
314 int64_t
GetCreateTimetag()
const {
return member_info_json_value_[kNIMSuperTeamUserKeyCreateTime].asUInt64(); }
317 void SetUpdateTimetag(int64_t timetag) { member_info_json_value_[kNIMSuperTeamUserKeyUpdateTime] = timetag; }
320 int64_t
GetUpdateTimetag()
const {
return member_info_json_value_[kNIMSuperTeamUserKeyUpdateTime].asUInt64(); }
323 void SetMute(
bool mute) { member_info_json_value_[kNIMSuperTeamUserKeyMute] = mute ? 1 : 0; }
326 bool IsMute()
const {
return member_info_json_value_[kNIMSuperTeamUserKeyMute].asUInt() == 1; }
329 void SetCustom(
const std::string& custom) { member_info_json_value_[kNIMSuperTeamUserKeyCustom] = custom; }
332 std::string
GetCustom()
const {
return member_info_json_value_[kNIMSuperTeamUserKeyCustom].asString(); }
339 bool ExistValue(
const std::string& nim_team_user_key)
const {
return member_info_json_value_.isMember(nim_team_user_key); }
345 std::string
ToJsonString()
const {
return GetJsonStringWithNoStyled(member_info_json_value_); }
351 nim_cpp_wrapper_util::Json::Value
ToJsonValue()
const {
return member_info_json_value_; }
354 nim_cpp_wrapper_util::Json::Value member_info_json_value_;
383 const std::string& team_id,
384 const NIMNotificationId notification_id,
385 const std::string& team_event_json,
410 NIM_SDK_CPPWRAPPER_DLL_API
bool ParseSuperTeamInfosJson(
const std::string& team_infos_json, std::list<SuperTeamInfo>& team_infos);
438 std::list<SuperTeamMemberProperty>& team_member_propertys);
441 #endif //_NIM_SDK_CPP_SUPERTEAM_HELPER_H_
void SetName(const std::string &name)
Definition: nim_super_team_helper.h:94
void SetCreateTimetag(int64_t timetag)
Definition: nim_super_team_helper.h:137
int64_t GetUpdateTimetag() const
Definition: nim_super_team_helper.h:146
std::string GetSuperTeamID() const
Definition: nim_super_team_helper.h:91
SuperTeamMemberProperty()
Definition: nim_super_team_helper.h:271
void SetJoinMode(nim::NIMSuperTeamJoinMode mode)
Definition: nim_super_team_helper.h:167
NIM_SDK_CPPWRAPPER_DLL_API void ParseSuperTeamInfoJson(const nim_cpp_wrapper_util::Json::Value &team_info_json, SuperTeamInfo &team_info)
解析群组信息
std::list< UserNameCard > namecards_
Definition: nim_super_team_helper.h:364
bool ExistValue(const std::string &nim_team_user_key) const
群成员信息信息数据标记Key对应的数据是否有效(存在,非初始值状态)
Definition: nim_super_team_helper.h:339
int GetBeInviteMode() const
Definition: nim_super_team_helper.h:194
void SetUpdateTimetag(int64_t timetag)
Definition: nim_super_team_helper.h:143
nim_cpp_wrapper_util::Json::Value ToJsonValue() const
获取JsonValue格式的数据
Definition: nim_super_team_helper.h:247
void SetMute(NIMSuperTeamMuteType mute_type)
Definition: nim_super_team_helper.h:220
void SetUpdateTimetag(int64_t timetag)
Definition: nim_super_team_helper.h:317
void SetAccountID(const std::string &id)
Definition: nim_super_team_helper.h:281
int64_t GetBits() const
Definition: nim_super_team_helper.h:302
void SetMemberValid(bool valid)
Definition: nim_super_team_helper.h:149
void SetUserType(nim::NIMSuperTeamUserType type)
Definition: nim_super_team_helper.h:287
std::string GetCustom() const
Definition: nim_super_team_helper.h:332
bool ExistValue(const std::string &nim_team_info_key) const
群组信息数据标记Key对应的数据是否有效(存在,非初始值状态)
Definition: nim_super_team_helper.h:235
void SetCustom(const std::string &custom)
Definition: nim_super_team_helper.h:329
nim_cpp_wrapper_util::Json::Value src_data_
Definition: nim_super_team_helper.h:369
std::string GetServerCustom() const
Definition: nim_super_team_helper.h:182
void SetIntro(const std::string &intro)
Definition: nim_super_team_helper.h:155
NIMSuperTeamInviteMode GetInviteMode() const
Definition: nim_super_team_helper.h:200
void SetValid(bool valid)
Definition: nim_super_team_helper.h:119
void SetServerCustom(const std::string &custom)
Definition: nim_super_team_helper.h:179
void operator=(const SuperTeamInfo &new_info)
Definition: nim_super_team_helper.h:33
void SetSuperTeamID(const std::string &id)
Definition: nim_super_team_helper.h:275
nim::NIMSuperTeamJoinMode GetJoinMode() const
Definition: nim_super_team_helper.h:170
std::string GetName() const
Definition: nim_super_team_helper.h:97
void SetIcon(const std::string &icon)
Definition: nim_super_team_helper.h:185
bool IsMemberValid() const
Definition: nim_super_team_helper.h:152
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_super_team_helper.h:345
SuperTeamInfo team_info_
Definition: nim_super_team_helper.h:365
std::string GetSuperTeamID() const
Definition: nim_super_team_helper.h:278
std::string attach_
Definition: nim_super_team_helper.h:368
void SetNick(const std::string &nick)
Definition: nim_super_team_helper.h:293
std::string ToJsonString() const
组装Json Value字符串
Definition: nim_super_team_helper.h:241
NIMSuperTeamMuteType GetMuteType() const
Definition: nim_super_team_helper.h:223
void SetAnnouncement(const std::string &announcement)
Definition: nim_super_team_helper.h:161
群组成员信息
Definition: nim_super_team_helper.h:261
void SetCreateTimetag(int64_t timetag)
Definition: nim_super_team_helper.h:311
bool IsMute() const
Definition: nim_super_team_helper.h:326
void Update(const SuperTeamInfo &new_info)
Definition: nim_super_team_helper.h:36
std::string GetOwnerID() const
Definition: nim_super_team_helper.h:103
void SetInviteMode(NIMSuperTeamInviteMode mode)
Definition: nim_super_team_helper.h:197
int64_t GetCreateTimetag() const
Definition: nim_super_team_helper.h:314
void SetMemberCount(int count)
Definition: nim_super_team_helper.h:125
void SetBeInviteMode(int be_invite_mode)
Definition: nim_super_team_helper.h:191
bool opt_
Definition: nim_super_team_helper.h:367
std::list< std::string > ids_
Definition: nim_super_team_helper.h:362
bool IsValid() const
Definition: nim_super_team_helper.h:122
群组信息
Definition: nim_super_team_helper.h:23
void SetUpdateInfoMode(NIMSuperTeamUpdateInfoMode mode)
Definition: nim_super_team_helper.h:205
NIMSuperTeamUpdateInfoMode GetUpdateInfoMode() const
Definition: nim_super_team_helper.h:208
int64_t GetMemberListTimetag() const
Definition: nim_super_team_helper.h:134
SuperTeamMemberProperty(const std::string &team_id, const std::string &accid, const nim::NIMSuperTeamUserType type)
Definition: nim_super_team_helper.h:264
NIM_SDK_CPPWRAPPER_DLL_API bool ParseSuperTeamMemberPropertysJson(const std::string &team_member_props_json, std::list< SuperTeamMemberProperty > &team_member_propertys)
解析群成员信息
void SetMute(bool mute)
Definition: nim_super_team_helper.h:323
void SetOwnerID(const std::string &id)
Definition: nim_super_team_helper.h:100
std::string GetProperty() const
Definition: nim_super_team_helper.h:116
std::string GetIntro() const
Definition: nim_super_team_helper.h:158
void SetProperty(const std::string &prop)
Definition: nim_super_team_helper.h:113
SuperTeamInfo()
Definition: nim_super_team_helper.h:29
void SetUpdateCustomMode(NIMSuperTeamUpdateCustomMode mode)
Definition: nim_super_team_helper.h:213
std::string GetCustom() const
Definition: nim_super_team_helper.h:176
void SetMemberListTimetag(int64_t timetag)
Definition: nim_super_team_helper.h:131
std::list< std::string > invalid_ids_
Definition: nim_super_team_helper.h:363
int GetMemberMaxCount() const
Definition: nim_super_team_helper.h:111
void SetSuperTeamID(const std::string &id)
Definition: nim_super_team_helper.h:88
std::string GetAccountID() const
Definition: nim_super_team_helper.h:284
群组事件通知
Definition: nim_super_team_helper.h:358
int64_t GetUpdateTimetag() const
Definition: nim_super_team_helper.h:320
int GetMemberCount() const
Definition: nim_super_team_helper.h:128
nim::NIMSuperTeamUserType GetUserType() const
Definition: nim_super_team_helper.h:290
NIMNotificationId notification_id_
Definition: nim_super_team_helper.h:360
void SetValid(bool valid)
Definition: nim_super_team_helper.h:305
bool IsValid() const
Definition: nim_super_team_helper.h:308
NIMResCode res_code_
Definition: nim_super_team_helper.h:359
nim_cpp_wrapper_util::Json::Value ToJsonValue() const
获取member info json value
Definition: nim_super_team_helper.h:351
std::string GetIcon() const
Definition: nim_super_team_helper.h:188
int64_t GetCreateTimetag() const
Definition: nim_super_team_helper.h:140
void SetMemberMaxCount(int count)
Definition: nim_super_team_helper.h:105
SuperTeamMemberProperty member_property_
Definition: nim_super_team_helper.h:366
NIM_SDK_CPPWRAPPER_DLL_API void ParseSuperTeamEvent(int rescode, const std::string &team_id, const NIMNotificationId notification_id, const std::string &team_event_json, SuperTeamEvent &team_event)
解析群组事件通知
void SetBits(int64_t bit)
Definition: nim_super_team_helper.h:299
std::string GetAnnouncement() const
Definition: nim_super_team_helper.h:164
std::string team_id_
Definition: nim_super_team_helper.h:361
NIMSuperTeamUpdateCustomMode GetUpdateCustomMode() const
Definition: nim_super_team_helper.h:216
NIM_SDK_CPPWRAPPER_DLL_API void ParseSuperTeamMemberPropertyJson(const nim_cpp_wrapper_util::Json::Value &team_member_prop_json, SuperTeamMemberProperty &team_member_property)
解析群成员信息
std::string GetNick() const
Definition: nim_super_team_helper.h:296
NIM_SDK_CPPWRAPPER_DLL_API bool ParseSuperTeamInfosJson(const std::string &team_infos_json, std::list< SuperTeamInfo > &team_infos)
解析群组信息
void SetCustom(const std::string &custom)
Definition: nim_super_team_helper.h:173
SuperTeamInfo(const std::string &team_id)
Definition: nim_super_team_helper.h:26