NIM SDK API  8.5.1
nim_talkex_helper_quick_comment.h
Go to the documentation of this file.
1 
7 #ifndef _NIM_SDK_CPP_TALKEX_HELPER_QUICK_COMMENT_H_
8 #define _NIM_SDK_CPP_TALKEX_HELPER_QUICK_COMMENT_H_
9 
10 #include <algorithm>
11 #include <functional>
12 #include <list>
13 #include <string>
14 #include "nim_define_include.h"
18 #include "nim_wrapper_util/nim_json_util.h"
23 namespace nim {
25 struct NIM_SDK_CPPWRAPPER_DLL_API QuickCommentInfo {
26  std::string id;
27  std::string from_account; //回复者的 accid
28  int64_t reply_type;
29  std::string client_id;
30  uint64_t server_id;
31  uint64_t time;
32  std::string ext;
33  bool need_push;
34  bool need_badge;
35  std::string push_title;
36  std::string push_content;
37  std::string push_payload;
39  static std::string ToJsonString(const QuickCommentInfo& info);
40  static void FromJsonString(const std::string& json_info, QuickCommentInfo& info);
41  static void FromJsonObject(const nim_cpp_wrapper_util::Json::Value& json_info, QuickCommentInfo& info);
42 };
43 
45 struct NIM_SDK_CPPWRAPPER_DLL_API RemoveQuickCommentParam {
46  std::string id;
47  int64_t reply_type;
48  std::string ext;
49  static std::string ToJsonString(const RemoveQuickCommentParam& param);
50 };
51 
53 struct NIM_SDK_CPPWRAPPER_DLL_API QueryQuickCommentsParam {
54  bool AddMessage(const IMMessage& message) {
55  if (message_list.size() > 20)
56  return false;
57  if (std::find_if(message_list.begin(), message_list.end(),
58  [&](const IMMessage& it) { return message.client_msg_id_.compare(it.client_msg_id_) == 0; }) != message_list.end())
59  return false;
60  message_list.emplace_back(message);
61  return true;
62  }
63  static std::string ToJsonString(const QueryQuickCommentsParam& param);
64 
65 private:
66  std::list<IMMessage> message_list;
67 };
68 
70 struct NIM_SDK_CPPWRAPPER_DLL_API QueryQuickCommentsResponse {
72  std::string message_client_id;
73  std::list<QuickCommentInfo> quick_comment_list;
74  };
75  std::list<QueryQuickCommentsResponseItem> message_quick_comment_list;
76  static void FromJsonString(const std::string& json_info, QueryQuickCommentsResponse& info);
77 };
78 } // namespace nim
79 
80 #endif //_NIM_SDK_CPP_TALKEX_HELPER_QUICK_COMMENT_H_
nim::RemoveQuickCommentParam::id
std::string id
Definition: nim_talkex_helper_quick_comment.h:46
nim::QuickCommentInfo::need_badge
bool need_badge
Definition: nim_talkex_helper_quick_comment.h:34
nim::QuickCommentInfo::reply_type
int64_t reply_type
Definition: nim_talkex_helper_quick_comment.h:28
nim::QuickCommentInfo::push_payload
std::string push_payload
Definition: nim_talkex_helper_quick_comment.h:37
nim::QuickCommentInfo::server_id
uint64_t server_id
Definition: nim_talkex_helper_quick_comment.h:30
nim::QuickCommentInfo::push_content
std::string push_content
Definition: nim_talkex_helper_quick_comment.h:36
nim_talk_helper.h
Talk 辅助方法和数据结构定义
nim::QuickCommentInfo::client_id
std::string client_id
Definition: nim_talkex_helper_quick_comment.h:29
nim::QuickCommentInfo::need_push
bool need_push
Definition: nim_talkex_helper_quick_comment.h:33
nim
namespace nim
nim::QueryQuickCommentsParam
查询快捷回复参数定义
Definition: nim_talkex_helper_quick_comment.h:53
nim::QuickCommentInfo
快捷回复属性
Definition: nim_talkex_helper_quick_comment.h:25
nim::QueryQuickCommentsResponse::QueryQuickCommentsResponseItem
Definition: nim_talkex_helper_quick_comment.h:71
nim::RemoveQuickCommentParam::ext
std::string ext
Definition: nim_talkex_helper_quick_comment.h:48
nim::RemoveQuickCommentParam::reply_type
int64_t reply_type
Definition: nim_talkex_helper_quick_comment.h:47
nim::RemoveQuickCommentParam
删除快捷回复参数定义
Definition: nim_talkex_helper_quick_comment.h:45
nim::QuickCommentInfo::time
uint64_t time
Definition: nim_talkex_helper_quick_comment.h:31
nim::QuickCommentInfo::push_title
std::string push_title
Definition: nim_talkex_helper_quick_comment.h:35
nim::QuickCommentInfo::ext
std::string ext
Definition: nim_talkex_helper_quick_comment.h:32
nim::QuickCommentInfo::from_account
std::string from_account
Definition: nim_talkex_helper_quick_comment.h:27
nim::QueryQuickCommentsResponse
查询快捷回复参数定义
Definition: nim_talkex_helper_quick_comment.h:70
nim_sdk_loader_helper.h
加载 NIM SDK 的帮助类头文件
nim_sdk_cpp_wrapper.h
定义导出宏
nim::IMMessage
Definition: nim_talk_helper.h:232