feat(work): 随官方更新微信客服读取消息相关接口模型

This commit is contained in:
Fu Diwei 2022-03-14 14:04:56 +08:00
parent 9be6a1943f
commit 3f8be0f00a
4 changed files with 94 additions and 2 deletions

View File

@ -25,5 +25,12 @@
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int? Limit { get; set; }
/// <summary>
/// 获取或设置语音消息类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("voice_format")]
[System.Text.Json.Serialization.JsonPropertyName("voice_format")]
public int? VoiceFormat { get; set; }
}
}

View File

@ -71,6 +71,19 @@
public class EventMessage
{
public static class Types
{
public class WechatChannels
{
/// <summary>
/// 获取或设置视频号昵称。
/// </summary>
[Newtonsoft.Json.JsonProperty("nickname")]
[System.Text.Json.Serialization.JsonPropertyName("nickname")]
public string? Nickname { get; set; }
}
}
/// <summary>
/// 获取或设置事件类型。
/// </summary>
@ -168,6 +181,13 @@
[Newtonsoft.Json.JsonProperty("msg_code")]
[System.Text.Json.Serialization.JsonPropertyName("msg_code")]
public string? MessageCode { get; set; }
/// <summary>
/// 获取或设置视频号信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("wechat_channels")]
[System.Text.Json.Serialization.JsonPropertyName("wechat_channels")]
public Types.WechatChannels? WechatChannels { get; set; }
}
}
@ -185,6 +205,34 @@
[System.Text.Json.Serialization.JsonPropertyName("msgtype")]
public string MessageType { get; set; } = default!;
/// <summary>
/// 获取或设置消息来源。
/// </summary>
[Newtonsoft.Json.JsonProperty("origin")]
[System.Text.Json.Serialization.JsonPropertyName("origin")]
public int MessageOrigin { get; set; }
/// <summary>
/// 获取或设置客服帐号 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_kfid")]
[System.Text.Json.Serialization.JsonPropertyName("open_kfid")]
public string? OpenKfId { get; set; }
/// <summary>
/// 获取或设置接待人员的 UserId。
/// </summary>
[Newtonsoft.Json.JsonProperty("servicer_userid")]
[System.Text.Json.Serialization.JsonPropertyName("servicer_userid")]
public string? ServicerUserId { get; set; }
/// <summary>
/// 获取或设置外部联系人账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("external_userid")]
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
public string? ExternalUserId { get; set; }
/// <summary>
/// 获取或设置文本消息信息。
/// </summary>
@ -261,9 +309,23 @@
[Newtonsoft.Json.JsonProperty("event")]
[System.Text.Json.Serialization.JsonPropertyName("event")]
public Types.EventMessage? MessageContentForEvent { get; set; }
/// <summary>
/// 获取或设置发送时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("send_time")]
[System.Text.Json.Serialization.JsonPropertyName("send_time")]
public long SendTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置消息列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("msg_list")]
[System.Text.Json.Serialization.JsonPropertyName("msg_list")]
public Types.Message[] MessageList { get; set; } = default!;
/// <summary>
/// 获取或设置是否还有更多数据。
/// </summary>
@ -276,8 +338,8 @@
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("cursor")]
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
[Newtonsoft.Json.JsonProperty("next_cursor")]
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
public string? NextCursor { get; set; }
}
}

View File

@ -0,0 +1,6 @@
{
"cursor": "4gw7MepFLfgF2VC5npN",
"token": "ENCApHxnGDNAVNY4AaSJKj4Tb5mwsEMzxhFmHVGcra996NR",
"limit": 1000,
"voice_format": 0
}

View File

@ -0,0 +1,17 @@
{
"errcode": 0,
"errmsg": "ok",
"next_cursor": "4gw7MepFLfgF2VC5npN",
"has_more": 1,
"msg_list": [
{
"msgid": "from_msgid_4622416642169452483",
"open_kfid": "wkAJ2GCAAASSm4_FhToWMFea0xAFfd3Q",
"external_userid": "wmAJ2GCAAAme1XQRC-NI-q0_ZM9ukoAw",
"send_time": 1615478585,
"origin": 3,
"servicer_userid": "Zhangsan",
"msgtype": "MSG_TYPE"
}
]
}