NIM PC Cross Platform SDK
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>
15#include "nim_define_include.h"
21namespace nim {
22
24struct NIM_SDK_CPPWRAPPER_DLL_API CollectInfo {
26 uint64_t id;
28 int64_t type;
30 std::string data;
32 std::string ext;
34 std::string unique_id;
36 uint64_t create_time;
38 uint64_t update_time;
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
45struct NIM_SDK_CPPWRAPPER_DLL_API CollectInfoList {
46 std::list<CollectInfo> list;
47 static void FromJsonString(const std::string& json_string, CollectInfoList& list);
48};
49
51struct NIM_SDK_CPPWRAPPER_DLL_API MatchCollectParm {
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
64struct NIM_SDK_CPPWRAPPER_DLL_API RemoveCollectsParm {
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
74struct NIM_SDK_CPPWRAPPER_DLL_API QueryCollectsParm {
76 uint64_t from_time;
78 uint64_t to_time;
80 uint64_t exclude_id;
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_
Represents a JSON value.
Definition: value.h:196
namespace nim
NIM 公共数据类型定义总的包含文件
JSON辅助方法
定义导出宏
加载 NIM SDK 的帮助类头文件
收藏内容属性
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
uint64_t update_time
更新时间
Definition: nim_talkex_helper_collect.h:38
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
收藏匹配参数
Definition: nim_talkex_helper_collect.h:51
分页查询收藏列表参数
Definition: nim_talkex_helper_collect.h:74
uint64_t to_time
结束时间,推荐当前时间+1小时
Definition: nim_talkex_helper_collect.h:78
uint64_t exclude_id
结束查询的最后一条收藏的id(不包含在查询结果中)缺省 可填0
Definition: nim_talkex_helper_collect.h:80
uint64_t from_time
起始时间,默认0
Definition: nim_talkex_helper_collect.h:76
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
收藏内容参数
Definition: nim_talkex_helper_collect.h:64