NIM SDK API  9.0.0
nim_talkex_helper_collect.h
Go to the documentation of this file.
1 
7 #ifndef _NIM_SDK_CPP_TALKEX_HELPER_COLLECT_H_
8 #define _NIM_SDK_CPP_TALKEX_HELPER_COLLECT_H_
9 
10 #include <functional>
11 #include <list>
12 #include <string>
13 #include "nim_define_include.h"
16 #include "nim_wrapper_util/nim_json_util.h"
21 namespace nim {
22 
24 struct NIM_SDK_CPPWRAPPER_DLL_API CollectInfo {
25  uint64_t id;
26  int64_t type;
27  std::string data;
28  std::string ext;
29  std::string unique_id;
30  uint64_t create_time;
31  uint64_t update_time;
32  static std::string ToJsonString(const CollectInfo& info);
33  static void FromJsonString(const std::string& json_string, CollectInfo& info);
34 };
35 
37 struct NIM_SDK_CPPWRAPPER_DLL_API CollectInfoList {
38  std::list<CollectInfo> list;
39  static void FromJsonString(const std::string& json_string, CollectInfoList& list);
40 };
41 
43 struct NIM_SDK_CPPWRAPPER_DLL_API MatchCollectParm {
44  MatchCollectParm(uint64_t collet_create_time, uint64_t collet_id)
45  : create_time(collet_create_time)
46  , id(collet_id) {}
47  uint64_t create_time;
48  uint64_t id;
49  static std::string ToJsonString(const MatchCollectParm& param);
50 };
51 
53 struct NIM_SDK_CPPWRAPPER_DLL_API RemoveCollectsParm {
54  void Add(const CollectInfo& info) { list.emplace_back(info.create_time, info.id); }
55  void Add(uint64_t id, uint64_t create_time) { list.emplace_back(create_time, id); }
56  int Size() const { return (int)list.size(); }
57  static std::string ToJsonString(const RemoveCollectsParm& info);
58 
59 private:
60  std::list<MatchCollectParm> list;
61 };
62 
64 struct NIM_SDK_CPPWRAPPER_DLL_API QueryCollectsParm {
65  uint64_t from_time;
66  uint64_t to_time;
67  uint64_t exclude_id;
68  int limit;
69  bool reverse;
70  int type;
71  static std::string ToJsonString(const QueryCollectsParm& info);
72 };
73 } // namespace nim
74 
75 #endif //_NIM_SDK_CPP_TALKEX_HELPER_COLLECT_H_
nim::CollectInfo::type
int64_t type
Definition: nim_talkex_helper_collect.h:26
nim::QueryCollectsParm::reverse
bool reverse
Definition: nim_talkex_helper_collect.h:69
nim::QueryCollectsParm::to_time
uint64_t to_time
Definition: nim_talkex_helper_collect.h:66
nim::CollectInfo::id
uint64_t id
Definition: nim_talkex_helper_collect.h:25
nim::CollectInfo::data
std::string data
Definition: nim_talkex_helper_collect.h:27
nim::QueryCollectsParm::exclude_id
uint64_t exclude_id
Definition: nim_talkex_helper_collect.h:67
nim::CollectInfo::ext
std::string ext
Definition: nim_talkex_helper_collect.h:28
nim::CollectInfo::unique_id
std::string unique_id
Definition: nim_talkex_helper_collect.h:29
nim::MatchCollectParm::create_time
uint64_t create_time
Definition: nim_talkex_helper_collect.h:47
nim::CollectInfo::create_time
uint64_t create_time
Definition: nim_talkex_helper_collect.h:30
nim::CollectInfoList
收藏列表
Definition: nim_talkex_helper_collect.h:37
nim::QueryCollectsParm::from_time
uint64_t from_time
Definition: nim_talkex_helper_collect.h:65
nim::MatchCollectParm::id
uint64_t id
Definition: nim_talkex_helper_collect.h:48
nim
namespace nim
nim::QueryCollectsParm
分页查询收藏列表参数
Definition: nim_talkex_helper_collect.h:64
nim::QueryCollectsParm::limit
int limit
Definition: nim_talkex_helper_collect.h:68
nim::CollectInfo::update_time
uint64_t update_time
Definition: nim_talkex_helper_collect.h:31
nim::RemoveCollectsParm
收藏内容参数
Definition: nim_talkex_helper_collect.h:53
nim::MatchCollectParm
收藏匹配参数
Definition: nim_talkex_helper_collect.h:43
nim::QueryCollectsParm::type
int type
Definition: nim_talkex_helper_collect.h:70
nim_sdk_loader_helper.h
加载 NIM SDK 的帮助类头文件
nim_sdk_cpp_wrapper.h
定义导出宏
nim::CollectInfo
收藏内容属性
Definition: nim_talkex_helper_collect.h:24