NIM PC Cross Platform SDK
载入中...
搜索中...
未找到
nim_talkex_helper_collect.h
浏览该文件的文档.
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>
15#include "nim_define_include.h"
21namespace nim {
22
26 uint64_t id{0};
28 int64_t type;
30 std::string data;
32 std::string ext;
34 std::string unique_id;
36 uint64_t create_time{0};
38 uint64_t update_time{0};
39 static std::string ToJsonString(const CollectInfo& info);
40 static nim_cpp_wrapper_util::Json::Value ToJsonObject(const CollectInfo& info);
41 static void FromJsonString(const std::string& json_string, CollectInfo& info);
42};
43
46 std::list<CollectInfo> list;
47 static void FromJsonString(const std::string& json_string, CollectInfoList& list);
48};
49
52 MatchCollectParm() = default;
53 MatchCollectParm(uint64_t collet_create_time, uint64_t collet_id)
54 : create_time(collet_create_time)
55 , id(collet_id) {}
57 uint64_t create_time{0};
59 uint64_t id{0};
60 static std::string ToJsonString(const MatchCollectParm& param);
61};
62
65 void Add(const CollectInfo& info) { list.emplace_back(info.create_time, info.id); }
66 void Add(uint64_t id, uint64_t create_time) { list.emplace_back(create_time, id); }
67 int Size() const { return (int)list.size(); }
68 static std::string ToJsonString(const RemoveCollectsParm& info);
69
70 std::list<MatchCollectParm> list;
71};
72
76 uint64_t from_time{0};
78 uint64_t to_time{0};
80 uint64_t exclude_id{0};
82 int limit;
84 bool reverse;
86 int type;
87 static std::string ToJsonString(const QueryCollectsParm& info);
88};
89} // namespace nim
90
91#endif //_NIM_SDK_CPP_TALKEX_HELPER_COLLECT_H_
NIM 公共数据类型定义总的包含文件
加载 NIM SDK 的帮助类头文件
定义导出宏
#define NIM_SDK_CPPWRAPPER_DLL_API
Definition: nim_sdk_cpp_wrapper.h:38
JSON辅助方法
namespace nim
收藏内容属性
Definition: nim_talkex_helper_collect.h:24
uint64_t create_time
创建时间
Definition: nim_talkex_helper_collect.h:36
std::string unique_id
去重唯一ID
Definition: nim_talkex_helper_collect.h:34
int64_t type
int 类型,开发者可根据业务自定义其含意
Definition: nim_talkex_helper_collect.h:28
std::string data
数据,string,最大20480
Definition: nim_talkex_helper_collect.h:30
std::string ext
扩展字段,string,最大1024
Definition: nim_talkex_helper_collect.h:32
uint64_t id
id
Definition: nim_talkex_helper_collect.h:26
收藏列表
Definition: nim_talkex_helper_collect.h:45
std::list< CollectInfo > list
Definition: nim_talkex_helper_collect.h:46
收藏匹配参数
Definition: nim_talkex_helper_collect.h:51
MatchCollectParm()=default
MatchCollectParm(uint64_t collet_create_time, uint64_t collet_id)
Definition: nim_talkex_helper_collect.h:53
收藏内容参数
Definition: nim_talkex_helper_collect.h:64
void Add(uint64_t id, uint64_t create_time)
Definition: nim_talkex_helper_collect.h:66
int Size() const
Definition: nim_talkex_helper_collect.h:67
void Add(const CollectInfo &info)
Definition: nim_talkex_helper_collect.h:65
std::list< MatchCollectParm > list
Definition: nim_talkex_helper_collect.h:70
分页查询收藏列表参数
Definition: nim_talkex_helper_collect.h:74
bool reverse
反向查询(按时间正序起查,正序排列),false:按时间逆序起查,逆序排列(建议默认为false)
Definition: nim_talkex_helper_collect.h:84
int type
收藏类型,缺省表示所有类型
Definition: nim_talkex_helper_collect.h:86
int limit
本次查询的上限(最多100条)
Definition: nim_talkex_helper_collect.h:82
Represents a JSON value.
Definition: value.h:196