zhaojs
2023-09-27 74098f1401afe40f961d1d167bb18dd0a71c4d59
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using System;
using System.Collections.Generic;
using System.Text;
 
namespace WeiXinKfSDK.Response
{
    public class SyncMsgResponse : WxKfBaseResponse
    {
        /// <summary>
        /// 下次调用带上该值,则从当前的位置继续往后拉,以实现增量拉取。 强烈建议对该字段入库保存,每次请求读取带上,请求结束后更新。避免因意外丢,导致必须从头开始拉取,引起消息延迟。
        /// </summary>
        public string next_cursor { get; set; }
        /// <summary>
        /// 是否还有更多数据。0-否;1-是  不能通过判断msg_list是否空来停止拉取,可能会出现has_more为1,而msg_list为空的情况
        /// </summary>
        public int has_more { get; set; }
        /// <summary>
        /// 消息列表
        /// </summary>
        public List<SyncMsgListDto> msg_list { get; set; }
    }
 
    public class SyncMsgListDto
    {
        /// <summary>
        /// 消息ID
        /// </summary>
        public string msgid { get; set; }
        /// <summary>
        /// 客服帐号ID
        /// </summary>
        public string open_kfid { get; set; }
        /// <summary>
        /// 客户UserID
        /// </summary>
        public string external_userid { get; set; }
        /// <summary>
        /// 消息发送时间
        /// </summary>
        public long send_time { get; set; }
        /// <summary>
        /// 消息来源。3-客户回复的消息 4-系统推送的消息
        /// </summary>
        public int origin { get; set; }
        /// <summary>
        /// 对不同的msgtype,有相应的结构描述,下面进一步说明
        /// </summary>
        public string msgtype { get; set; }
        /// <summary>
        /// 事件消息
        /// </summary>
        public EnterEventDto Event { get; set; }
        /// <summary>
        /// 文本消息
        /// </summary>
        public WxTextDto text { get; set; }
    }
 
    public class WxTextDto
    { 
        public string content { get; set; }
 
        public string menu_id { get; set; }
    }
 
 
    public class EnterEventDto
    {
        /// <summary>
        /// 事件类型。此处固定为:enter_session
        /// </summary>
        public string event_type { get; set; }
        /// <summary>
        /// 客服账号ID
        /// </summary>
        public string open_kfid { get; set; }
        /// <summary>
        /// 客户UserID
        /// </summary>
        public string external_userid { get; set; }
        /// <summary>
        /// 进入会话的场景值,获取客服帐号链接开发者自定义的场景值
        /// </summary>
        public string scene { get; set; }
        /// <summary>
        /// 进入会话的自定义参数,获取客服帐号链接返回的url,开发者按规范拼接的scene_param参数
        /// </summary>
        public string scene_param { get; set; }
        /// <summary>
        /// 如果满足发送欢迎语条件(条件为:用户在过去48小时里未收过欢迎语,且未向客服发过消息),会返回该字段。
        /// </summary>
        public string welcome_code { get; set; }
        /// <summary>
        /// 进入会话的视频号信息,从视频号进入会话才有值
        /// </summary>
        public EnterEventDtoChannel wechat_channels { get; set; }
    }
 
    public class EnterEventDtoChannel
    {
        /// <summary>
        /// 视频号小店名称,视频号场景值为4、5时返回此项
        /// </summary>
        public string nickname { get; set; }
        /// <summary>
        /// 视频号场景值。1:视频号主页,2:视频号直播间商品列表页,3:视频号商品橱窗页,4:视频号小店商品详情页,5:视频号小店订单页
        /// </summary>
        public int scene { get; set; }
    }
 
}