mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-09-19 01:58:14 +08:00
feat(work): 随官方更新客户联系接口相关字段
This commit is contained in:
@@ -110,6 +110,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/set_workbench_template 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92535 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94620 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -133,6 +134,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/get_workbench_template 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92535 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94620 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
@@ -156,6 +158,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/agent/set_workbench_data 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/92535 </para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/94620 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
|
@@ -268,6 +268,26 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactBatchToExternalUserIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/opengid_to_chatid 接口。</para>
|
||||
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/94822 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinExternalContactOpenGroupIdToChatIdResponse> ExecuteCgibinExternalContactOpenGroupIdToChatIdAsync(this WechatWorkClient client, Models.CgibinExternalContactOpenGroupIdToChatIdRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "externalcontact", "opengid_to_chatid")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinExternalContactOpenGroupIdToChatIdResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
#region ContactWay
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/externalcontact/add_contact_way 接口。</para>
|
||||
|
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/opengid_to_chatid 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactOpenGroupIdToChatIdRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置小程序在微信获取到的群 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("opengid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("opengid")]
|
||||
public string OpenGroupId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/externalcontact/opengid_to_chatid 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinExternalContactOpenGroupIdToChatIdResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置客户群 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_id")]
|
||||
public string GroupChatId { get; set; } = default!;
|
||||
}
|
||||
}
|
@@ -14,5 +14,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[Newtonsoft.Json.JsonProperty("chat_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_id")]
|
||||
public string GroupChatId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否需要返回群成员的名字。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("need_name")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.NumberTypedNullableBooleanConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("need_name")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedNullableBooleanConverter))]
|
||||
public bool? RequireMemberName { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -57,6 +57,20 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("invitor")]
|
||||
public Types.Invitor? Invitor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员群昵称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("group_nickname")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("group_nickname")]
|
||||
public string? GroupNickname { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置入群场景值。
|
||||
/// </summary>
|
||||
|
@@ -10,7 +10,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class TextMessage
|
||||
public class Text
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文本消息内容。
|
||||
@@ -112,6 +112,16 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("pic_media_id")]
|
||||
public string? PictureMediaId { get; set; }
|
||||
}
|
||||
|
||||
public class File
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置文件 MediaId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -148,6 +158,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[Newtonsoft.Json.JsonProperty("miniprogram")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("miniprogram")]
|
||||
public Types.MiniProgram? MiniProgram { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文件附件信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("file")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("file")]
|
||||
public Types.File? File { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +194,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("text")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("text")]
|
||||
public Types.TextMessage? Text { get; set; }
|
||||
public Types.Text? Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附件列表。
|
||||
|
@@ -14,7 +14,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class TextMessage : CgibinExternalContactAddMessageTemplateRequest.Types.TextMessage
|
||||
public class Text : CgibinExternalContactAddMessageTemplateRequest.Types.Text
|
||||
{
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("text")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("text")]
|
||||
public Types.TextMessage? Text { get; set; }
|
||||
public Types.Text? Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置附件列表。
|
||||
|
@@ -29,6 +29,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
public class MiniProgramMessage : CgibinExternalContactSendWelcomeMessageRequest.Types.Attachment.Types.MiniProgram
|
||||
{
|
||||
}
|
||||
|
||||
public class FileMessage : CgibinExternalContactSendWelcomeMessageRequest.Types.Attachment.Types.File
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -66,6 +70,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("miniprogram")]
|
||||
public Types.MiniProgramMessage? MiniProgram { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文件消息信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("file")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("file")]
|
||||
public Types.FileMessage? File { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否通知成员将这条入群欢迎语应用到客户群中。
|
||||
/// </summary>
|
||||
|
@@ -29,6 +29,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
public class MiniProgramMessage : CgibinExternalContactGroupWelcomeTemplateAddRequest.Types.MiniProgramMessage
|
||||
{
|
||||
}
|
||||
|
||||
public class FileMessage : CgibinExternalContactSendWelcomeMessageRequest.Types.Attachment.Types.File
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -73,6 +77,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("miniprogram")]
|
||||
public Types.MiniProgramMessage? MiniProgram { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文件消息信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("file")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("file")]
|
||||
public Types.FileMessage? File { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方安装的应用 ID。
|
||||
/// </summary>
|
||||
|
@@ -29,6 +29,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
public class MiniProgramMessage : CgibinExternalContactGroupWelcomeTemplateAddRequest.Types.MiniProgramMessage
|
||||
{
|
||||
}
|
||||
|
||||
public class FileMessage : CgibinExternalContactSendWelcomeMessageRequest.Types.Attachment.Types.File
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -66,6 +70,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("miniprogram")]
|
||||
public Types.MiniProgramMessage? MiniProgram { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文件消息信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("file")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("file")]
|
||||
public Types.FileMessage? File { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方安装的应用 ID。
|
||||
/// </summary>
|
||||
|
@@ -10,7 +10,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class TextMessage : CgibinExternalContactAddMessageTemplateRequest.Types.TextMessage
|
||||
public class TextMessage : CgibinExternalContactAddMessageTemplateRequest.Types.Text
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -163,6 +163,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_corp_name")]
|
||||
public string? CorpName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置视频号名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wechat_channels")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wechat_channels")]
|
||||
public string? WechatChannels { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置对外自定义字段列表。
|
||||
/// </summary>
|
||||
|
@@ -163,6 +163,13 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_corp_name")]
|
||||
public string CorpName { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置视频号名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("wechat_channels")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("wechat_channels")]
|
||||
public string? WechatChannels { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置对外自定义字段列表。
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user