mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-10 17:56:21 +08:00
feat(work): 新增服务商会话内容存档相关接口
This commit is contained in:
@@ -4,7 +4,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
/// <para>表示 INFO.cancel_auth 事件的数据。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/90642 ]]>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/90642 ]]> <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97086 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class CancelAuthEvent : ChangeAuthEvent
|
||||
|
||||
@@ -5,7 +5,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/90642 ]]> <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99401 ]]>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99401 ]]> <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97086 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class ChangeAuthEvent : WechatWorkEvent
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.chat_archive_audit_approved_single 事件的数据。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99532 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class ChatArchiveAuditApprovedSingleEvent : WechatWorkEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("SuiteId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
|
||||
[System.Xml.Serialization.XmlElement("SuiteId")]
|
||||
public string SuiteId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId")]
|
||||
public string AuthorizerCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业服务人员的 OpenUserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("OpenUserID")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("OpenUserID")]
|
||||
[System.Xml.Serialization.XmlElement("OpenUserID", IsNullable = true)]
|
||||
public string? OpenUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置外部联系人的 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ExternalUserID")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ExternalUserID")]
|
||||
[System.Xml.Serialization.XmlElement("ExternalUserID", IsNullable = true)]
|
||||
public string? ExternalUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置客户群 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("ChatId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("ChatId")]
|
||||
[System.Xml.Serialization.XmlElement("ChatId", IsNullable = true)]
|
||||
public string? GroupChatId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.hit_keyword 事件的数据。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97244 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class ChatArchiveExportFinishedEvent : WechatWorkEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("SuiteId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
|
||||
[System.Xml.Serialization.XmlElement("SuiteId")]
|
||||
public string SuiteId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId")]
|
||||
public string AuthorizerCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("JobId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("JobId")]
|
||||
[System.Xml.Serialization.XmlElement("JobId", IsNullable = true)]
|
||||
public string JobId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.conversation_new_message 事件的数据。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97085 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class ConversationNewMessageEvent : WechatWorkEvent
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置第三方应用的 SuiteId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("SuiteId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("SuiteId")]
|
||||
[System.Xml.Serialization.XmlElement("SuiteId")]
|
||||
public string SuiteId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("AuthCorpId")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("AuthCorpId")]
|
||||
[System.Xml.Serialization.XmlElement("AuthCorpId")]
|
||||
public string AuthorizerCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用于获取会话记录的 Token。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("Token")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("Token")]
|
||||
[System.Xml.Serialization.XmlElement("Token", IsNullable = true)]
|
||||
public string Token { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 INFO.hit_keyword 事件的数据。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97244 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class HitKeywordEvent : ConversationNewMessageEvent
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Events
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/90642 ]]> <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/90795 ]]>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/90795 ]]> <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97086 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class CreateAuthEvent : WechatWorkEvent
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.Finance
|
||||
{
|
||||
/// <summary>
|
||||
/// 用于构造 <see cref="WechatWorkFinanceClient"/> 实例的构造器。
|
||||
/// </summary>
|
||||
public partial class WechatWorkFinanceClientBuilder : ICommonClientBuilder<WechatWorkFinanceClient>
|
||||
{
|
||||
private readonly WechatWorkFinanceClientOptions _options;
|
||||
private readonly IList<Action<CommonClientSettings>> _configures;
|
||||
private readonly IList<HttpInterceptor> _interceptors;
|
||||
|
||||
private WechatWorkFinanceClientBuilder(WechatWorkFinanceClientOptions options)
|
||||
{
|
||||
_options = options;
|
||||
_configures = new List<Action<CommonClientSettings>>();
|
||||
_interceptors = new List<HttpInterceptor>();
|
||||
}
|
||||
|
||||
ICommonClientBuilder<WechatWorkFinanceClient> ICommonClientBuilder<WechatWorkFinanceClient>.ConfigureSettings(Action<CommonClientSettings> configure)
|
||||
{
|
||||
return ConfigureSettings(configure);
|
||||
}
|
||||
|
||||
ICommonClientBuilder<WechatWorkFinanceClient> ICommonClientBuilder<WechatWorkFinanceClient>.UseInterceptor(HttpInterceptor interceptor)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
ICommonClientBuilder<WechatWorkFinanceClient> ICommonClientBuilder<WechatWorkFinanceClient>.UseHttpClient(HttpClient httpClient, bool disposeClient)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public WechatWorkFinanceClientBuilder ConfigureSettings(Action<CommonClientSettings> configure)
|
||||
{
|
||||
if (configure is null) throw new ArgumentNullException(nameof(configure));
|
||||
|
||||
_configures.Add(configure);
|
||||
return this;
|
||||
}
|
||||
|
||||
public WechatWorkFinanceClient Build()
|
||||
{
|
||||
WechatWorkFinanceClient client = new WechatWorkFinanceClient(_options);
|
||||
|
||||
foreach (Action<CommonClientSettings> configure in _configures)
|
||||
{
|
||||
client.Configure(configure);
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
}
|
||||
|
||||
partial class WechatWorkFinanceClientBuilder
|
||||
{
|
||||
public static WechatWorkFinanceClientBuilder Create(WechatWorkFinanceClientOptions options)
|
||||
{
|
||||
if (options is null) throw new ArgumentNullException(nameof(options));
|
||||
|
||||
return new WechatWorkFinanceClientBuilder(options);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.Finance
|
||||
{
|
||||
/// <summary>
|
||||
/// 当调用企业微信会话内容存档 API 出错时引发的异常。
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi
|
||||
{
|
||||
public static class WechatWorkSpecialApiClientExecuteSpecialExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /spec/gettoken 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99473 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.SpecialGetTokenResponse> ExecuteSpecialGetTokenAsync(this WechatWorkSpecialApiClient client, Models.SpecialGetTokenRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "spec", "gettoken")
|
||||
.WithHeader("auth-corpid", null);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.SpecialGetTokenResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /spec/list_job 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99467 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.SpecialListJobResponse> ExecuteSpecialListJobAsync(this WechatWorkSpecialApiClient client, Models.SpecialListJobRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "spec", "list_job")
|
||||
.WithHeader("auth-corpid", null)
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.SpecialListJobResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /spec/exec_and_report_job 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99469 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.SpecialExecuteAndReportJobResponse> ExecuteSpecialExecuteAndReportJobAsync(this WechatWorkSpecialApiClient client, Models.SpecialExecuteAndReportJobRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "spec", "exec_and_report_job")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.SpecialExecuteAndReportJobResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /spec/fetch_msg 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99468 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.SpecialFetchMessageResponse> ExecuteSpecialFetchMessageAsync(this WechatWorkSpecialApiClient client, Models.SpecialFetchMessageRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "spec", "fetch_msg")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.SpecialFetchMessageResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [GET] /spec/download_media 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99470 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.SpecialDownloadMediaResponse> ExecuteSpecialDownloadMediaAsync(this WechatWorkSpecialApiClient client, Models.SpecialDownloadMediaRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Get, "spec", "download_media")
|
||||
.SetQueryParam("access_token", request.AccessToken)
|
||||
.SetQueryParam("media_id", request.MediaId);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.SpecialDownloadMediaResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Interceptors
|
||||
{
|
||||
using System.Text;
|
||||
using SKIT.FlurlHttpClient;
|
||||
using SKIT.FlurlHttpClient.Internal;
|
||||
using SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi;
|
||||
|
||||
internal class WechatWorkSpecialApiRequestSigningInterceptor : HttpInterceptor
|
||||
{
|
||||
private readonly string _secret;
|
||||
|
||||
public WechatWorkSpecialApiRequestSigningInterceptor(string secret)
|
||||
{
|
||||
_secret = secret;
|
||||
}
|
||||
|
||||
public override async Task BeforeCallAsync(HttpInterceptorContext context, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (context is null) throw new ArgumentNullException(nameof(context));
|
||||
if (context.FlurlCall.Completed) throw new WechatWorkSpecialApiException("Failed to sign request. This interceptor must be called before request completed.");
|
||||
|
||||
string method = context.FlurlCall.HttpRequestMessage.Method.ToString().ToUpper();
|
||||
string path = context.FlurlCall.HttpRequestMessage.RequestUri?.AbsolutePath ?? string.Empty;
|
||||
string query = context.FlurlCall.HttpRequestMessage.RequestUri?.Query?.TrimStart('?') ?? string.Empty;
|
||||
string timestamp = DateTimeOffset.Now.ToLocalTime().ToUnixTimeSeconds().ToString();
|
||||
string nonce = Guid.NewGuid().ToString("N");
|
||||
string authCorpId = context.FlurlCall.Request.Headers.GetAll("auth-corpid").FirstOrDefault() ?? string.Empty;
|
||||
string body = string.Empty;
|
||||
|
||||
if (context.FlurlCall.HttpRequestMessage?.Content is not null)
|
||||
{
|
||||
if (method != "GET")
|
||||
{
|
||||
HttpContent httpContent = context.FlurlCall.HttpRequestMessage.Content;
|
||||
body = await _AsyncEx.RunTaskWithCancellationTokenAsync(httpContent.ReadAsStringAsync(), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder signData = new StringBuilder();
|
||||
signData.Append(!string.IsNullOrEmpty(authCorpId) ? $"auth-corpid={authCorpId}\n" : string.Empty);
|
||||
signData.Append($"body-md5={Utilities.MD5Utility.Hash(body).Value!.ToLower()}\n");
|
||||
signData.Append($"timestamp={timestamp}\n");
|
||||
signData.Append($"method={method}\n");
|
||||
signData.Append($"nonce={nonce}\n");
|
||||
signData.Append($"url={path}\n");
|
||||
signData.Append(!string.IsNullOrEmpty(query) ? $"query={query}\n" : string.Empty);
|
||||
signData.Append("\n");
|
||||
string sign;
|
||||
|
||||
try
|
||||
{
|
||||
sign = Utilities.HMACUtility.HashWithSHA256(_secret, signData.ToString()).Value!.ToLower();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new WechatWorkSpecialApiException("Failed to sign request. Please see the inner exception for more details.", ex);
|
||||
}
|
||||
|
||||
context.FlurlCall.Request.WithHeader("nonce", nonce);
|
||||
context.FlurlCall.Request.WithHeader("timestamp", timestamp);
|
||||
context.FlurlCall.Request.WithHeader("signature", sign);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /spec/download_media 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class SpecialDownloadMediaRequest : WechatWorkSpecialApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置素材 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [GET] /spec/download_media 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SpecialDownloadMediaResponse : WechatWorkSpecialApiResponse
|
||||
{
|
||||
public override bool IsSuccessful()
|
||||
{
|
||||
return base.IsSuccessful() && GetRawHeaders().ContainsKey("Content-Disposition");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /spec/exec_and_report_job 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class SpecialExecuteAndReportJobRequest : WechatWorkSpecialApiRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("job_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("job_type")]
|
||||
public string JobType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务结果数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public string? DataString { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务进度(单位:百分数)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("progress")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("progress")]
|
||||
public int? Progress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result")]
|
||||
public Types.Result? Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /spec/exec_and_report_job 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SpecialExecuteAndReportJobResponse : WechatWorkSpecialApiResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /spec/fetch_msg 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class SpecialFetchMessageRequest : WechatWorkSpecialApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /spec/fetch_msg 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SpecialFetchMessageResponse : WechatWorkSpecialApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Message
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Sender
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置身份类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string Id { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Receiver : Sender
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgid")]
|
||||
public string MessageId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgtype")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgtype")]
|
||||
public int MessageType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置发送者信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sender")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sender")]
|
||||
public Types.Sender Sender { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置接收者列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("receiver_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("receiver_list")]
|
||||
public Types.Receiver[]? ReceiverList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置群 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chatid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chatid")]
|
||||
public string? GroupChatId { 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("is_recalled")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("is_recalled")]
|
||||
public bool IsRecalled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置扩展字段。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonExtensionData]
|
||||
[System.Text.Json.Serialization.JsonExtensionData]
|
||||
public IDictionary<string, object>? ExtendedData { 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>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /spec/gettoken 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class SpecialGetTokenRequest : WechatWorkSpecialApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置服务商 CorpId。如果不指定将使用构造 <see cref="WechatWorkSpecialApiClient"/> 时的 <see cref="WechatWorkSpecialApiClientOptions.ProviderCorpId"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("model_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("model_id")]
|
||||
public string? CorpId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置数据分析专区 Secret。如果不指定将使用构造 <see cref="WechatWorkSpecialApiClient"/> 时的 <see cref="WechatWorkSpecialApiClientOptions.SpecialSecret"/> 参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("secret")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("secret")]
|
||||
public string? Secret { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /spec/gettoken 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SpecialGetTokenResponse : WechatWorkSpecialApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置数据分析专区接口凭证。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("access_token")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("access_token")]
|
||||
public string AccessToken { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置接口凭证有效期(单位:秒)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("expires_in")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
|
||||
public int ExpiresIn { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /spec/list_job 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class SpecialListJobRequest : WechatWorkSpecialApiRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /spec/list_job 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class SpecialListJobResponse : WechatWorkSpecialApiResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Job
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("auth_corpid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("auth_corpid")]
|
||||
public string AuthorizerCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置自定义数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("custom_data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("custom_data")]
|
||||
public string? CustomData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置创建时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("create_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
|
||||
public long CreateTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("job_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("job_list")]
|
||||
public Types.Job[] JobList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Settings
|
||||
{
|
||||
public sealed class Credentials
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化客户端时 <see cref="WechatWorkSpecialApiClientOptions.ProviderCorpId"/> 的副本。
|
||||
/// </summary>
|
||||
public string ProviderCorpId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化客户端时 <see cref="WechatWorkSpecialApiClientOptions.SpecialSecret"/> 的副本。
|
||||
/// </summary>
|
||||
public string SpecialSecret { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化客户端时 <see cref="WechatWorkSpecialApiClientOptions.SignSecret"/> 的副本。
|
||||
/// </summary>
|
||||
public string SignSecret { get; }
|
||||
|
||||
internal Credentials(WechatWorkSpecialApiClientOptions options)
|
||||
{
|
||||
if (options is null) throw new ArgumentNullException(nameof(options));
|
||||
|
||||
ProviderCorpId = options.ProviderCorpId;
|
||||
SpecialSecret = options.SpecialSecret;
|
||||
SignSecret = options.SignSecret;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi
|
||||
{
|
||||
/// <summary>
|
||||
/// 一个企业微信数据分析专区 API HTTP 客户端。
|
||||
/// </summary>
|
||||
public sealed class WechatWorkSpecialApiClient : CommonClientBase, ICommonClient
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取当前客户端使用的企业微信数据分析专区凭证。
|
||||
/// </summary>
|
||||
public Settings.Credentials Credentials { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 用指定的配置项初始化 <see cref="WechatWorkClient"/> 类的新实例。
|
||||
/// </summary>
|
||||
/// <param name="options">配置项。</param>
|
||||
public WechatWorkSpecialApiClient(WechatWorkSpecialApiClientOptions options)
|
||||
: this(options, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="options"></param>
|
||||
/// <param name="httpClient"></param>
|
||||
/// <param name="disposeClient"></param>
|
||||
internal WechatWorkSpecialApiClient(WechatWorkSpecialApiClientOptions options, HttpClient? httpClient, bool disposeClient = true)
|
||||
: base(httpClient, disposeClient)
|
||||
{
|
||||
if (options is null) throw new ArgumentNullException(nameof(options));
|
||||
|
||||
Credentials = new Settings.Credentials(options);
|
||||
|
||||
FlurlClient.BaseUrl = options.Endpoint ?? WechatWorkSpecialApiEndpoints.DEFAULT;
|
||||
FlurlClient.WithTimeout(options.Timeout <= 0 ? Timeout.InfiniteTimeSpan : TimeSpan.FromMilliseconds(options.Timeout));
|
||||
|
||||
Interceptors.Add(new Interceptors.WechatWorkSpecialApiRequestSigningInterceptor(options.SignSecret));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用当前客户端生成一个新的 <see cref="IFlurlRequest"/> 对象。
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="httpMethod"></param>
|
||||
/// <param name="urlSegments"></param>
|
||||
/// <returns></returns>
|
||||
public IFlurlRequest CreateFlurlRequest(WechatWorkSpecialApiRequest request, HttpMethod httpMethod, params object[] urlSegments)
|
||||
{
|
||||
IFlurlRequest flurlRequest = base.CreateFlurlRequest(request, httpMethod, urlSegments);
|
||||
|
||||
if (request.AuthorizerCorpId is not null)
|
||||
{
|
||||
flurlRequest.WithHeader("auth-corpid", request.AuthorizerCorpId);
|
||||
}
|
||||
|
||||
return flurlRequest;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步发起请求。
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="flurlRequest"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<T> SendFlurlRequestAsJsonAsync<T>(IFlurlRequest flurlRequest, object? data = null, CancellationToken cancellationToken = default)
|
||||
where T : WechatWorkSpecialApiResponse, new()
|
||||
{
|
||||
if (flurlRequest is null) throw new ArgumentNullException(nameof(flurlRequest));
|
||||
|
||||
bool isSimpleRequest = data is null ||
|
||||
flurlRequest.Verb == HttpMethod.Get ||
|
||||
flurlRequest.Verb == HttpMethod.Head ||
|
||||
flurlRequest.Verb == HttpMethod.Options;
|
||||
using IFlurlResponse flurlResponse = isSimpleRequest ?
|
||||
await base.SendFlurlRequestAsync(flurlRequest, null, cancellationToken).ConfigureAwait(false) :
|
||||
await base.SendFlurlRequestAsJsonAsync(flurlRequest, data, cancellationToken).ConfigureAwait(false);
|
||||
return await WrapFlurlResponseAsJsonAsync<T>(flurlResponse, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi
|
||||
{
|
||||
/// <summary>
|
||||
/// 一个用于构造 <see cref="WechatWorkSpecialApiClient"/> 时使用的配置项。
|
||||
/// </summary>
|
||||
public class WechatWorkSpecialApiClientOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置请求超时时间(单位:毫秒)。
|
||||
/// <para>默认值:30000</para>
|
||||
/// </summary>
|
||||
public int Timeout { get; set; } = 30 * 1000;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信数据分析专区 API 入口点。
|
||||
/// <para>默认值:<see cref="WechatWorkSpecialApiEndpoints.DEFAULT"/></para>
|
||||
/// </summary>
|
||||
public string Endpoint { get; set; } = WechatWorkSpecialApiEndpoints.DEFAULT;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信服务商 CorpId。
|
||||
/// </summary>
|
||||
public string ProviderCorpId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信数据分析专区 Secret 。
|
||||
/// </summary>
|
||||
public string SpecialSecret { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信数据分析专区签名密钥。
|
||||
/// </summary>
|
||||
public string SignSecret { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>企业微信数据分析专区 API 接口域名。</para>
|
||||
/// </summary>
|
||||
public static class WechatWorkSpecialApiEndpoints
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认域名。
|
||||
/// </summary>
|
||||
public const string DEFAULT = "https://specapi.weixin.qq.com";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi
|
||||
{
|
||||
/// <summary>
|
||||
/// 当调用企业微信数据分析专区 API 出错时引发的异常。
|
||||
/// </summary>
|
||||
public class WechatWorkSpecialApiException : WechatWorkException
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public WechatWorkSpecialApiException()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public WechatWorkSpecialApiException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public WechatWorkSpecialApiException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示企业微信数据分析专区 API 请求的基类。
|
||||
/// </summary>
|
||||
public abstract class WechatWorkSpecialApiRequest : CommonRequestBase, ICommonRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信数据分析专区的 AccessToken。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public virtual string? AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置授权方的 CorpId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonIgnore]
|
||||
[System.Text.Json.Serialization.JsonIgnore]
|
||||
public virtual string? AuthorizerCorpId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi
|
||||
{
|
||||
/// <summary>
|
||||
/// 表示企业微信数据分析专区 API 响应的基类。
|
||||
/// </summary>
|
||||
public abstract class WechatWorkSpecialApiResponse : CommonResponseBase, ICommonResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取企业微信数据分析专区 API 返回的错误码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
|
||||
public virtual int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取企业微信数据分析专区 API 返回的错误描述。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||
public virtual string? ErrorMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取一个值,该值指示调用企业微信数据分析专区 API 是否成功。
|
||||
/// <para>
|
||||
///(即 HTTP 状态码为 200,且 <see cref="ErrorCode"/> 值为 0)
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override bool IsSuccessful()
|
||||
{
|
||||
return GetRawStatus() == 200 && ErrorCode == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,555 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Flurl;
|
||||
using Flurl.Http;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
{
|
||||
public static class WechatWorkClientExecuteCgibinChatDataExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/get_auth_user_list 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99641 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataGetAuthUserListResponse> ExecuteCgibinChatDataGetAuthUserListAsync(this WechatWorkClient client, Models.CgibinChatDataGetAuthUserListRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "get_auth_user_list")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataGetAuthUserListResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/set_public_key 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99587 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataSetPublicKeyResponse> ExecuteCgibinChatDataSetPublicKeyAsync(this WechatWorkClient client, Models.CgibinChatDataSetPublicKeyRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "set_public_key")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataSetPublicKeyResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/sync_msg 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97240 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataSyncMessageResponse> ExecuteCgibinChatDataSyncMessageAsync(this WechatWorkClient client, Models.CgibinChatDataSyncMessageRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "sync_msg")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataSyncMessageResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/groupchat/get 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99495 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataGroupChatGetResponse> ExecuteCgibinChatDataGroupChatGetAsync(this WechatWorkClient client, Models.CgibinChatDataGroupChatGetRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "groupchat", "get")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataGroupChatGetResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
#region AgreeStatus
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/getagreestatus/single 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99530 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataGetAgreeStatusSingleResponse> ExecuteCgibinChatDataGetAgreeStatusSingleAsync(this WechatWorkClient client, Models.CgibinChatDataGetAgreeStatusSingleRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "getagreestatus", "single")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataGetAgreeStatusSingleResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/getagreestatus/room 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99530 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataGetAgreeStatusRoomResponse> ExecuteCgibinChatDataGetAgreeStatusRoomAsync(this WechatWorkClient client, Models.CgibinChatDataGetAgreeStatusRoomRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "getagreestatus", "room")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataGetAgreeStatusRoomResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region AnalyzeTask
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/analyze_task_add 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99527 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataAnalyzeTaskAddResponse> ExecuteCgibinChatDataAnalyzeTaskAddAsync(this WechatWorkClient client, Models.CgibinChatDataAnalyzeTaskAddRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "analyze_task_add")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataAnalyzeTaskAddResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/analyze_task_submit 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99527 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataAnalyzeTaskSubmitResponse> ExecuteCgibinChatDataAnalyzeTaskSubmitAsync(this WechatWorkClient client, Models.CgibinChatDataAnalyzeTaskSubmitRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "analyze_task_submit")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataAnalyzeTaskSubmitResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/analyze_task_result 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99527 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataAnalyzeTaskResultResponse> ExecuteCgibinChatDataAnalyzeTaskResultAsync(this WechatWorkClient client, Models.CgibinChatDataAnalyzeTaskResultRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "analyze_task_result")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataAnalyzeTaskResultResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Export
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/export/create_job 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99620 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataExportCreateJobResponse> ExecuteCgibinChatDataExportCreateJobAsync(this WechatWorkClient client, Models.CgibinChatDataExportCreateJobRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "export", "create_job")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataExportCreateJobResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/export/get_job_status 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99620 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataExportGetJobStatusResponse> ExecuteCgibinChatDataExportGetJobStatusAsync(this WechatWorkClient client, Models.CgibinChatDataExportGetJobStatusRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "export", "get_job_status")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataExportGetJobStatusResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region HideSensitiveInfoConfig
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/set_hide_sensitiveinfo_config 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99622 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataSetHideSensitiveInfoConfigResponse> ExecuteCgibinChatDataSetHideSensitiveInfoConfigAsync(this WechatWorkClient client, Models.CgibinChatDataSetHideSensitiveInfoConfigRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "set_hide_sensitiveinfo_config")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataSetHideSensitiveInfoConfigResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/get_hide_sensitiveinfo_config 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99622 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataGetHideSensitiveInfoConfigResponse> ExecuteCgibinChatDataGetHideSensitiveInfoConfigAsync(this WechatWorkClient client, Models.CgibinChatDataGetHideSensitiveInfoConfigRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "get_hide_sensitiveinfo_config")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataGetHideSensitiveInfoConfigResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Keyword
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/keyword/create_rule 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97237 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataKeywordCreateRuleResponse> ExecuteCgibinChatDataKeywordCreateRuleAsync(this WechatWorkClient client, Models.CgibinChatDataKeywordCreateRuleRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "keyword", "create_rule")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataKeywordCreateRuleResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/keyword/update_rule 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97237 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataKeywordUpdateRuleResponse> ExecuteCgibinChatDataKeywordUpdateRuleAsync(this WechatWorkClient client, Models.CgibinChatDataKeywordUpdateRuleRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "keyword", "update_rule")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataKeywordUpdateRuleResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/keyword/delete_rule 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97237 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataKeywordDeleteRuleResponse> ExecuteCgibinChatDataKeywordDeleteRuleAsync(this WechatWorkClient client, Models.CgibinChatDataKeywordDeleteRuleRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "keyword", "delete_rule")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataKeywordDeleteRuleResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/keyword/get_rule_list 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97237 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataKeywordGetRuleListResponse> ExecuteCgibinChatDataKeywordGetRuleListAsync(this WechatWorkClient client, Models.CgibinChatDataKeywordGetRuleListRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "keyword", "get_rule_list")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataKeywordGetRuleListResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/keyword/get_rule_detail 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97237 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataKeywordGetRuleDetailResponse> ExecuteCgibinChatDataKeywordGetRuleDetailAsync(this WechatWorkClient client, Models.CgibinChatDataKeywordGetRuleDetailRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "keyword", "get_rule_detail")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataKeywordGetRuleDetailResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/keyword/get_hit_msg_list 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97266 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataKeywordGetHitMessageListResponse> ExecuteCgibinChatDataKeywordGetHitMessageListAsync(this WechatWorkClient client, Models.CgibinChatDataKeywordGetHitMessageListRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "keyword", "get_hit_msg_list")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataKeywordGetHitMessageListResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Search
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/search_chat 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99496 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataSearchChatResponse> ExecuteCgibinChatDataSearchChatAsync(this WechatWorkClient client, Models.CgibinChatDataSearchChatRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "search_chat")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataSearchChatResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/search_msg 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/97374 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataSearchMessageResponse> ExecuteCgibinChatDataSearchMessageAsync(this WechatWorkClient client, Models.CgibinChatDataSearchMessageRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "search_msg")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataSearchMessageResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SecurityApi
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/specapi/create_job 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99460 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataSecurityApiCreateJobResponse> ExecuteCgibinChatDataSecurityApiCreateJobAsync(this WechatWorkClient client, Models.CgibinChatDataSecurityApiCreateJobRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "specapi", "create_job")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataSecurityApiCreateJobResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/chatdata/specapi/get_job_result 接口。</para>
|
||||
/// <para>
|
||||
/// REF: <br/>
|
||||
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99462 ]]>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinChatDataSecurityApiGetJobResultResponse> ExecuteCgibinChatDataSecurityApiGetJobResultAsync(this WechatWorkClient client, Models.CgibinChatDataSecurityApiGetJobResultRequest 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
|
||||
.CreateFlurlRequest(request, HttpMethod.Post, "cgi-bin", "chatdata", "specapi", "get_job_result")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinChatDataSecurityApiGetJobResultResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false); ;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/getagreestatus/room 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGetAgreeStatusRoomRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置群 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chatid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chatid")]
|
||||
public string GroupChatId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/getagreestatus/room 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGetAgreeStatusRoomResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AgreeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置外部成员 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
|
||||
public string ExteranalUserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置同意情况。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agree_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agree_status")]
|
||||
public string AgreeStatus { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置状态改变时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status_change_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status_change_time")]
|
||||
public long ChangeTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会话同意情况列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agreeinfo")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agreeinfo")]
|
||||
public Types.AgreeInfo[] AgreeInfoList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/getagreestatus/single 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGetAgreeStatusSingleRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class User
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员的密文 UserId。与字段 <see cref="ExteranalUserId"/> 二选一。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("open_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
|
||||
public string? OpenUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置外部成员 UserId。与字段 <see cref="OpenUserId"/> 二选一。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
|
||||
public string? ExteranalUserId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("item")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("item")]
|
||||
public IList<Types.User> UserList { get; set; } = new List<Types.User>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/getagreestatus/single 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGetAgreeStatusSingleResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AgreeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员的密文 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("open_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
|
||||
public string? OpenUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置外部成员 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
|
||||
public string? ExteranalUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置同意情况。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agree_status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agree_status")]
|
||||
public string AgreeStatus { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置状态改变时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status_change_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status_change_time")]
|
||||
public long ChangeTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会话同意情况列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("agreeinfo")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("agreeinfo")]
|
||||
public Types.AgreeInfo[] AgreeInfoList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/analyze_task_add 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataAnalyzeTaskAddRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Message
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class EncryptInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置密钥。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("secret_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("secret_key")]
|
||||
public string SecretKey { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgid")]
|
||||
public string MessageId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置加密信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("encrypt_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("encrypt_info")]
|
||||
public Types.EncryptInfo EncryptInfo { get; set; } = new Types.EncryptInfo();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("analyze_task")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("analyze_task")]
|
||||
public int TaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string? JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg_list")]
|
||||
public IList<Types.Message> MessageList { get; set; } = new List<Types.Message>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/analyze_task_add 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataAnalyzeTaskAddResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class FailedMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgid")]
|
||||
public string MessageId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||
public string? ErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string? JobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置提交失败的消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("fail_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("fail_list")]
|
||||
public Types.FailedMessage[]? FailedMessageList { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/analyze_task_result 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataAnalyzeTaskResultRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/analyze_task_result 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataAnalyzeTaskResultResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class BatchResult
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ServiceEncryptInfo : CgibinChatDataSyncMessageResponse.Types.Message.Types.ServiceEncryptInfo
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分析结果临时 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result_id")]
|
||||
public string ResultId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置加密信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("service_encrypt_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("service_encrypt_info")]
|
||||
public Types.ServiceEncryptInfo ServiceEncryptInfo { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class ItemResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgid")]
|
||||
public string MessageId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errcode")]
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置错误信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("errmsg")]
|
||||
public string? ErrorMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置情感分析结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sentiment_result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sentiment_result")]
|
||||
public int? SentimentResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置反垃圾分析结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("spam_result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("spam_result")]
|
||||
public int? SpamResult { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置批量任务的分析结果。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("analyze_result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("analyze_result")]
|
||||
public Types.BatchResult? BatchResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置单条任务的分析结果列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("analyze_result_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("analyze_result_list")]
|
||||
public Types.ItemResult[]? ItemResultList { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/analyze_task_submit 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataAnalyzeTaskSubmitRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/analyze_task_submit 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataAnalyzeTaskSubmitResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/get_auth_user_list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGetAuthUserListRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/get_auth_user_list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGetAuthUserListResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class AuthUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置授权成员的密文 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("open_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
|
||||
public string OpenUserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置生效的版本列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("edition_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("edition_list")]
|
||||
public int[] EditionList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置生效成员列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("auth_user_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("auth_user_list")]
|
||||
public Types.AuthUser[] AuthUserList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanReadOnlyConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanReadOnlyConverter))]
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/groupchat/get 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGroupChatGetRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置群 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chatid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chatid")]
|
||||
public string GroupChatId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/groupchat/get 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGroupChatGetResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Member
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("memberid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("memberid")]
|
||||
public string Id { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置入群时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jointime")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jointime")]
|
||||
public long JoinTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置群成员列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("members")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("members")]
|
||||
public Types.Member[] MemberList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置创建者的密文 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("creator")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("creator")]
|
||||
public string CreatorOpenUserId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置创建时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("room_create_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("room_create_time")]
|
||||
public long CreateTimestamp { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/set_public_key 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSetPublicKeyRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置公钥。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("public_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("public_key")]
|
||||
public string PublicKey { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公钥版本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("public_key_ver")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("public_key_ver")]
|
||||
public int PublicKeyVersion { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/set_public_key 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSetPublicKeyResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/sync_msg 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSyncMessageRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置回调事件返回的 Token。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("token")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("token")]
|
||||
public string? Token { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/sync_msg 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSyncMessageResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Message
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Sender
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置身份类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id")]
|
||||
public string Id { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class Receiver : Sender
|
||||
{
|
||||
}
|
||||
|
||||
public class ServiceEncryptInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置加密后的密钥。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("encrypted_secret_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("encrypted_secret_key")]
|
||||
public string EncryptedSecretKey { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置公钥版本。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("public_key_ver")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("public_key_ver")]
|
||||
public int PublicKeyVersion { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgid")]
|
||||
public string MessageId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgtype")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgtype")]
|
||||
public int MessageType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置发送者信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("sender")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("sender")]
|
||||
public Types.Sender Sender { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置接收者列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("receiver_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("receiver_list")]
|
||||
public Types.Receiver[]? ReceiverList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置群 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chatid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chatid")]
|
||||
public string? GroupChatId { 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("service_encrypt_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("service_encrypt_info")]
|
||||
public Types.ServiceEncryptInfo ServiceEncryptInfo { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg_list")]
|
||||
public Types.Message[] MessageList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanReadOnlyConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanReadOnlyConverter))]
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/export/create_job 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataExportCreateJobRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会话展示组件的 Code。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("code")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("code")]
|
||||
public string TaskType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置导出内容的模板文件素材 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("media_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("media_id")]
|
||||
public string MediaId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/export/create_job 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataExportCreateJobResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/export/get_job_status 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataExportGetJobStatusRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/export/get_job_status 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataExportGetJobStatusResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result_id")]
|
||||
public string? ResultId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果错误码。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result_errcode")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result_errcode")]
|
||||
public int? ResultErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果错误信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result_errmsg")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result_errmsg")]
|
||||
public string? ResultErrorMessage { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/get_hide_sensitiveinfo_config 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGetHideSensitiveInfoConfigRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员的密文 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("open_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
|
||||
public string OpenUserId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/get_hide_sensitiveinfo_config 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataGetHideSensitiveInfoConfigResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置是否隐藏手机号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hide_mobile")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hide_mobile")]
|
||||
public bool IsHideMobileNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否隐藏身份证号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hide_idcard")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hide_idcard")]
|
||||
public bool IsHideIdCardNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否隐藏银行卡号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hide_bankno")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hide_bankno")]
|
||||
public bool IsHideBankCardNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config")]
|
||||
public Types.Config Config { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/set_hide_sensitiveinfo_config 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSetHideSensitiveInfoConfigRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置是否隐藏手机号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hide_mobile")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hide_mobile")]
|
||||
public bool? IsHideMobileNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否隐藏身份证号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hide_idcard")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hide_idcard")]
|
||||
public bool? IsHideIdCardNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否隐藏银行卡号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hide_bankno")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hide_bankno")]
|
||||
public bool? IsHideBankCardNumber { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置成员的密文 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("open_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
|
||||
public string OpenUserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置配置信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("config")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("config")]
|
||||
public Types.Config Config { get; set; } = new Types.Config ();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/set_hide_sensitiveinfo_config 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSetHideSensitiveInfoConfigResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/create_rule 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordCreateRuleRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class KeywordList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键词列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("word_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("word_list")]
|
||||
public IList<string> Items { get; set; } = new List<string>();
|
||||
}
|
||||
|
||||
public class SemanticsList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键行为列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("semantics_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("semantics_list")]
|
||||
public IList<int> Items { get; set; } = new List<int>();
|
||||
}
|
||||
|
||||
public class ApplicableRange
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class TargetTypeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置对象类型列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type_list")]
|
||||
public IList<int>? TypeList { get; set; }
|
||||
}
|
||||
|
||||
public class ChatTypeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会话类型列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type_list")]
|
||||
public IList<int>? TypeList { get; set; }
|
||||
}
|
||||
|
||||
public class DepartmentInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id_list")]
|
||||
public IList<long>? DepartmentIdList { get; set; }
|
||||
}
|
||||
|
||||
public class GroupChatInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置群 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id_list")]
|
||||
public IList<string>? GroupChatIdList { get; set; }
|
||||
}
|
||||
|
||||
public class UserInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id_list")]
|
||||
public IList<string>? UserIdList { get; set; }
|
||||
}
|
||||
|
||||
public class ExternalContactInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置外部联系人 UserId 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id_list")]
|
||||
public IList<string>? ExternalUserIdList { get; set; }
|
||||
}
|
||||
|
||||
public class SessionTypeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会话范围列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("session_type_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("session_type_list")]
|
||||
public IList<int>? SessionTypeList { get; set; }
|
||||
}
|
||||
|
||||
public class ExcludeMobileList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mobile_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mobile_list")]
|
||||
public IList<string>? Items { get; set; }
|
||||
}
|
||||
|
||||
public class ExcludeEmailList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置邮箱列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("email_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("email_list")]
|
||||
public IList<string>? Items { get; set; }
|
||||
}
|
||||
|
||||
public class ExcludeBankCardList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置银行卡号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bank_card_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bank_card_list")]
|
||||
public IList<string>? Items { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的对象类型信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("target_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("target_type")]
|
||||
public Types.TargetTypeInfo? TargetTypeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的会话类型信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_type")]
|
||||
public Types.ChatTypeInfo? ChatTypeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的部门信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department")]
|
||||
public Types.DepartmentInfo? DepartmentInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的员工信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user")]
|
||||
public Types.UserInfo? UserInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的客户信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_contact")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_contact")]
|
||||
public Types.ExternalContactInfo? ExternalContactInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的群聊信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat")]
|
||||
public Types.GroupChatInfo? GroupChatInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的会话范围信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("session_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("session_type")]
|
||||
public Types.SessionTypeInfo? SessionTypeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码白名单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exclude_mobile")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exclude_mobile")]
|
||||
public Types.ExcludeMobileList? ExcludeMobileList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置邮箱白名单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exclude_email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exclude_email")]
|
||||
public Types.ExcludeEmailList? ExcludeEmailList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置银行卡号白名单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exclude_bank_card")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exclude_bank_card")]
|
||||
public Types.ExcludeBankCardList? ExcludeBankCardList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置规则名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键词列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("keyword")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("keyword")]
|
||||
public Types.KeywordList KeywordList { get; set; } = new Types.KeywordList();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键行为列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("semantics")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("semantics")]
|
||||
public Types.SemanticsList? SemanticsList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用范围配置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("applicable_range")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("applicable_range")]
|
||||
public Types.ApplicableRange? ApplicableRange { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/create_rule 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordCreateRuleResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键词规则 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("rule_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
|
||||
public string RuleId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/delete_rule 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordDeleteRuleRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键词规则 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("rule_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
|
||||
public string RuleId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/delete_rule 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordDeleteRuleResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/get_hit_msg_list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordGetHitMessageListRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置回调事件返回的 Token。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("token")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("token")]
|
||||
public string? Token { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/get_hit_msg_list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordGetHitMessageListResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Message
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class HitRule
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键词规则 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("rule_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
|
||||
public string RuleId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否命中关键词。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_hit_keyword")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_hit_keyword")]
|
||||
public bool HasHitKeyword { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键行为列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("semantics_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("semantics_list")]
|
||||
public int[]? SemanticsList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgid")]
|
||||
public string MessageId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置命中的规则列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("hit_rule_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("hit_rule_list")]
|
||||
public Types.HitRule[] HitRuleList { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg_list")]
|
||||
public Types.Message[] MessageList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanReadOnlyConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanReadOnlyConverter))]
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/get_rule_detail 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordGetRuleDetailRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键词规则 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("rule_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
|
||||
public string RuleId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/get_rule_detail 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordGetRuleDetailResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class KeywordList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键词列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("word_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("word_list")]
|
||||
public string[] Items { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class SemanticsList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置关键行为列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("semantics_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("semantics_list")]
|
||||
public int[] Items { get; set; } = default!;
|
||||
}
|
||||
|
||||
public class ApplicableRange
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class TargetTypeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置对象类型列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type_list")]
|
||||
public int[]? TypeList { get; set; }
|
||||
}
|
||||
|
||||
public class ChatTypeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会话类型列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type_list")]
|
||||
public int[]? TypeList { get; set; }
|
||||
}
|
||||
|
||||
public class DepartmentInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置部门 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id_list")]
|
||||
public long[]? DepartmentIdList { get; set; }
|
||||
}
|
||||
|
||||
public class GroupChatInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置群 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id_list")]
|
||||
public string[]? GroupChatIdList { get; set; }
|
||||
}
|
||||
|
||||
public class UserInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id_list")]
|
||||
public string[]? UserIdList { get; set; }
|
||||
}
|
||||
|
||||
public class ExternalContactInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置外部联系人 UserId 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id_list")]
|
||||
public string[]? ExternalUserIdList { get; set; }
|
||||
}
|
||||
|
||||
public class SessionTypeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置会话范围列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("session_type_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("session_type_list")]
|
||||
public int[]? SessionTypeList { get; set; }
|
||||
}
|
||||
|
||||
public class ExcludeMobileList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("mobile_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("mobile_list")]
|
||||
public string[]? Items { get; set; }
|
||||
}
|
||||
|
||||
public class ExcludeEmailList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置邮箱列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("email_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("email_list")]
|
||||
public string[]? Items { get; set; }
|
||||
}
|
||||
|
||||
public class ExcludeBankCardList
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置银行卡号列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("bank_card_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("bank_card_list")]
|
||||
public string[]? Items { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的对象类型信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("target_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("target_type")]
|
||||
public Types.TargetTypeInfo? TargetTypeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的会话类型信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_type")]
|
||||
public Types.ChatTypeInfo? ChatTypeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的部门信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department")]
|
||||
public Types.DepartmentInfo? DepartmentInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的员工信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user")]
|
||||
public Types.UserInfo? UserInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的客户信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_contact")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_contact")]
|
||||
public Types.ExternalContactInfo? ExternalContactInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的群聊信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat")]
|
||||
public Types.GroupChatInfo? GroupChatInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的会话范围信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("session_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("session_type")]
|
||||
public Types.SessionTypeInfo? SessionTypeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码白名单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exclude_mobile")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exclude_mobile")]
|
||||
public Types.ExcludeMobileList? ExcludeMobileList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置邮箱白名单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exclude_email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exclude_email")]
|
||||
public Types.ExcludeEmailList? ExcludeEmailList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置银行卡号白名单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exclude_bank_card")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exclude_bank_card")]
|
||||
public Types.ExcludeBankCardList? ExcludeBankCardList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置规则名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键词列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("keyword")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("keyword")]
|
||||
public Types.KeywordList KeywordList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键行为列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("semantics")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("semantics")]
|
||||
public Types.SemanticsList? SemanticsList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用范围配置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("applicable_range")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("applicable_range")]
|
||||
public Types.ApplicableRange? ApplicableRange { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/get_rule_list 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordGetRuleListRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/get_rule_list 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordGetRuleListResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Rule
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置规则 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("rule_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
|
||||
public string RuleId { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置规则名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置创建时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("create_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("create_time")]
|
||||
public long CreateTimetamp { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键词规则列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("rule_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("rule_list")]
|
||||
public Types.Rule[] RuleList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanReadOnlyConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanReadOnlyConverter))]
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/update_rule 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordUpdateRuleRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class KeywordList : CgibinChatDataKeywordCreateRuleRequest.Types.KeywordList
|
||||
{
|
||||
}
|
||||
|
||||
public class SemanticsList : CgibinChatDataKeywordCreateRuleRequest.Types.SemanticsList
|
||||
{
|
||||
}
|
||||
|
||||
public class ApplicableRange
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class TargetTypeInfo : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.TargetTypeInfo
|
||||
{
|
||||
}
|
||||
|
||||
public class ChatTypeInfo : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.ChatTypeInfo
|
||||
{
|
||||
}
|
||||
|
||||
public class DepartmentInfo : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.DepartmentInfo
|
||||
{
|
||||
}
|
||||
|
||||
public class GroupChatInfo : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.GroupChatInfo
|
||||
{
|
||||
}
|
||||
|
||||
public class UserInfo : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.UserInfo
|
||||
{
|
||||
}
|
||||
|
||||
public class ExternalContactInfo : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.ExternalContactInfo
|
||||
{
|
||||
}
|
||||
|
||||
public class SessionTypeInfo : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.DepartmentInfo
|
||||
{
|
||||
}
|
||||
|
||||
public class ExcludeMobileList : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.ExcludeMobileList
|
||||
{
|
||||
}
|
||||
|
||||
public class ExcludeEmailList : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.ExcludeEmailList
|
||||
{
|
||||
}
|
||||
|
||||
public class ExcludeBankCardList : CgibinChatDataKeywordCreateRuleRequest.Types.ApplicableRange.Types.ExcludeBankCardList
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的对象类型信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("target_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("target_type")]
|
||||
public Types.TargetTypeInfo? TargetTypeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的会话类型信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_type")]
|
||||
public Types.ChatTypeInfo? ChatTypeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的部门信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("department")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("department")]
|
||||
public Types.DepartmentInfo? DepartmentInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的员工信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("user")]
|
||||
public Types.UserInfo? UserInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的客户信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_contact")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_contact")]
|
||||
public Types.ExternalContactInfo? ExternalContactInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的群聊信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat")]
|
||||
public Types.GroupChatInfo? GroupChatInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用的会话范围信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("session_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("session_type")]
|
||||
public Types.SessionTypeInfo? SessionTypeInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置手机号码白名单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exclude_mobile")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exclude_mobile")]
|
||||
public Types.ExcludeMobileList? ExcludeMobileList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置邮箱白名单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exclude_email")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exclude_email")]
|
||||
public Types.ExcludeEmailList? ExcludeEmailList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置银行卡号白名单信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("exclude_bank_card")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("exclude_bank_card")]
|
||||
public Types.ExcludeBankCardList? ExcludeBankCardList { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键词规则 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("rule_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
|
||||
public string RuleId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置规则名称。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键词列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("keyword")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("keyword")]
|
||||
public Types.KeywordList? KeywordList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置关键行为列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("semantics")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("semantics")]
|
||||
public Types.SemanticsList? SemanticsList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置适用范围配置。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("applicable_range")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("applicable_range")]
|
||||
public Types.ApplicableRange? ApplicableRange { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/keyword/update_rule 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataKeywordUpdateRuleResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/search_chat 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSearchChatRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置搜索词。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("query_word")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("query_word")]
|
||||
public string QueryWord { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/search_chat 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSearchChatResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class GroupChat
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置群 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chatid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chatid")]
|
||||
public string GroupChatId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置群列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_list")]
|
||||
public Types.GroupChat[] GroupChatList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanReadOnlyConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanReadOnlyConverter))]
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/search_msg 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSearchMessageRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class ChatInfo
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class IdInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员的密文 UserId。与字段 <see cref="ExteranalUserId"/> 二选一。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("open_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
|
||||
public string? OpenUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置外部成员 UserId。与字段 <see cref="OpenUserId"/> 二选一。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
|
||||
public string? ExteranalUserId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置会话类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_type")]
|
||||
public int ChatType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置 ID 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("id_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("id_list")]
|
||||
public IList<Types.IdInfo> IdList { get; set; } = new List<Types.IdInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置搜索词。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("query_word")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("query_word")]
|
||||
public string QueryWord { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置搜索的客户会话信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("chat_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("chat_info")]
|
||||
public Types.ChatInfo? ChatInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置搜索会话范围的起始时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("start_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
|
||||
public long? StartTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置搜索会话范围的结束时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("end_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
|
||||
public long? EndTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
|
||||
public string? Cursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页每页数量。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("limit")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("limit")]
|
||||
public int? Limit { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/search_msg 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSearchMessageResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Message
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgid")]
|
||||
public string MessageId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg_list")]
|
||||
public Types.Message[] MessageList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置分页游标。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.Common.NumericalBooleanReadOnlyConverter))]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.Common.NumericalBooleanReadOnlyConverter))]
|
||||
public bool HasMore { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/specapi/create_job 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSecurityApiCreateJobRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class MessageFilter
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Message
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class EncryptInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置密钥。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("secret_key")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("secret_key")]
|
||||
public string SecretKey { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msgid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msgid")]
|
||||
public string MessageId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置加密信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("encrypt_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("encrypt_info")]
|
||||
public Types.EncryptInfo EncryptInfo { get; set; } = new Types.EncryptInfo();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg_list")]
|
||||
public IList<Types.Message> MessageList { get; set; } = new List<Types.Message>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置消息过滤参数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("msg_filter")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("msg_filter")]
|
||||
public Types.MessageFilter MessageFilter { get; set; } = new Types.MessageFilter();
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置自定义 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("custom_id")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("custom_id")]
|
||||
public string CustomId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置自定义数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("custom_data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("custom_data")]
|
||||
public string? CustomData { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/specapi/create_job 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSecurityApiCreateJobResponse : WechatWorkResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/specapi/get_job_result 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSecurityApiGetJobResultRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务 ID。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("jobid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
|
||||
public string JobId { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/chatdata/specapi/get_job_result 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinChatDataSecurityApiGetJobResultResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Result
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置任务类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("job_type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("job_type")]
|
||||
public string JobType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务结果数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("data")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("data")]
|
||||
public string? DataString { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务状态。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("status")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("status")]
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务开始时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("dispatch_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("dispatch_time")]
|
||||
public long DispatchTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置任务进度(单位:百分数)。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("progress")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("progress")]
|
||||
public int Progress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结果信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("result")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("result")]
|
||||
public Types.Result? Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Utilities
|
||||
{
|
||||
using SKIT.FlurlHttpClient.Primitives;
|
||||
|
||||
/// <summary>
|
||||
/// HMAC 算法工具类。
|
||||
/// </summary>
|
||||
public static class HMACUtility
|
||||
{
|
||||
/// <summary>
|
||||
/// 计算 HMAC-SHA-256 哈希值。
|
||||
/// </summary>
|
||||
/// <param name="keyBytes">密钥字节数组。</param>
|
||||
/// <param name="messageBytes">要计算哈希值的信息字节数组。</param>
|
||||
/// <returns>哈希值字节数组。</returns>
|
||||
public static byte[] HashWithSHA256(byte[] keyBytes, byte[] messageBytes)
|
||||
{
|
||||
if (keyBytes is null) throw new ArgumentNullException(nameof(keyBytes));
|
||||
if (messageBytes is null) throw new ArgumentNullException(nameof(messageBytes));
|
||||
|
||||
#if NET5_0_OR_GREATER
|
||||
return HMACSHA256.HashData(keyBytes, messageBytes);
|
||||
#else
|
||||
using HMAC hmac = new HMACSHA256(keyBytes);
|
||||
return hmac.ComputeHash(messageBytes);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算 HMAC-SHA-256 哈希值。
|
||||
/// </summary>
|
||||
/// <param name="key">密钥。</param>
|
||||
/// <param name="messageData">要计算哈希值的信息。</param>
|
||||
/// <returns>经过十六进制编码的哈希值。</returns>
|
||||
public static EncodedString HashWithSHA256(string key, string messageData)
|
||||
{
|
||||
if (key is null) throw new ArgumentNullException(nameof(key));
|
||||
if (messageData is null) throw new ArgumentNullException(nameof(messageData));
|
||||
|
||||
byte[] keyBytes = EncodedString.FromLiteralString(key);
|
||||
byte[] messageBytes = EncodedString.FromLiteralString(messageData);
|
||||
byte[] hashBytes = HashWithSHA256(keyBytes, messageBytes);
|
||||
return EncodedString.ToHexString(hashBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/SKIT.FlurlHttpClient.Wechat.Work/Utilities/MD5Utility.cs
Normal file
44
src/SKIT.FlurlHttpClient.Wechat.Work/Utilities/MD5Utility.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Utilities
|
||||
{
|
||||
using SKIT.FlurlHttpClient.Primitives;
|
||||
|
||||
/// <summary>
|
||||
/// MD5 算法工具类。
|
||||
/// </summary>
|
||||
public static class MD5Utility
|
||||
{
|
||||
/// <summary>
|
||||
/// 计算 MD5 哈希值。
|
||||
/// </summary>
|
||||
/// <param name="messageBytes">要计算哈希值的信息字节数组。</param>
|
||||
/// <returns>哈希值字节数组。</returns>
|
||||
public static byte[] Hash(byte[] messageBytes)
|
||||
{
|
||||
if (messageBytes is null) throw new ArgumentNullException(nameof(messageBytes));
|
||||
|
||||
#if NET5_0_OR_GREATER
|
||||
return MD5.HashData(messageBytes);
|
||||
#else
|
||||
using MD5 md5 = MD5.Create();
|
||||
return md5.ComputeHash(messageBytes);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算 MD5 哈希值。
|
||||
/// </summary>
|
||||
/// <param name="messageData">要计算哈希值的信息。</param>
|
||||
/// <returns>经过十六进制编码的哈希值。</returns>
|
||||
public static EncodedString Hash(string messageData)
|
||||
{
|
||||
if (messageData is null) throw new ArgumentNullException(nameof(messageData));
|
||||
|
||||
byte[] messageBytes = EncodedString.FromLiteralString(messageData);
|
||||
byte[] hashBytes = Hash(messageBytes);
|
||||
return EncodedString.ToHexString(hashBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<xml>
|
||||
<SuiteId><![CDATA[xxxx]]></SuiteId>
|
||||
<AuthCorpId><![CDATA[yyyy]]></AuthCorpId>
|
||||
<InfoType><![CDATA[chat_archive_audit_approved_single]]></InfoType>
|
||||
<TimeStamp>1403610513</TimeStamp>
|
||||
<OpenUserID><![CDATA[xxxx]]></OpenUserID>
|
||||
<ExternalUserID><![CDATA[xxxx]]></ExternalUserID>
|
||||
<ChatId><![CDATA[xxxx]]></ChatId>
|
||||
</xml>
|
||||
@@ -0,0 +1,7 @@
|
||||
<xml>
|
||||
<SuiteId><![CDATA[xxxx]]></SuiteId>
|
||||
<AuthCorpId><![CDATA[yyyy]]></AuthCorpId>
|
||||
<InfoType><![CDATA[chat_archive_export_finished]]></InfoType>
|
||||
<JobId><![CDATA[zzzzzzz]]></JobId>
|
||||
<TimeStamp>1403610513</TimeStamp>
|
||||
</xml>
|
||||
@@ -0,0 +1,7 @@
|
||||
<xml>
|
||||
<SuiteId><![CDATA[xxxx]]></SuiteId>
|
||||
<AuthCorpId><![CDATA[yyyy]]></AuthCorpId>
|
||||
<InfoType><![CDATA[conversation_new_message]]></InfoType>
|
||||
<Token><![CDATA[zzzzzzzzzzz]]></Token>
|
||||
<TimeStamp>1403610513</TimeStamp>
|
||||
</xml>
|
||||
@@ -0,0 +1,7 @@
|
||||
<xml>
|
||||
<SuiteId><![CDATA[xxxx]]></SuiteId>
|
||||
<AuthCorpId><![CDATA[yyyy]]></AuthCorpId>
|
||||
<InfoType><![CDATA[hit_keyword]]></InfoType>
|
||||
<Token><![CDATA[zzzzzzz]]></Token>
|
||||
<TimeStamp>1403610513</TimeStamp>
|
||||
</xml>
|
||||
@@ -6,6 +6,8 @@ using Xunit;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.UnitTests
|
||||
{
|
||||
using SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi;
|
||||
|
||||
public class CodeAnalyzeTests
|
||||
{
|
||||
[Fact(DisplayName = "代码质量分析")]
|
||||
@@ -24,6 +26,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.UnitTests
|
||||
SdkResponseModelDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.Work.Models",
|
||||
SdkExecutingExtensionDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.Work",
|
||||
SdkWebhookEventDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.Work.Events",
|
||||
IgnoreExecutingExtensionTypes = static type => type.Namespace!.Contains(".ExtendedSDK."),
|
||||
ThrowOnNotFoundRequestModelTypes = true,
|
||||
ThrowOnNotFoundResponseModelTypes = true,
|
||||
ThrowOnNotFoundExecutingExtensionTypes = true,
|
||||
@@ -55,6 +58,21 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.UnitTests
|
||||
};
|
||||
new SourceFileAnalyzer(options).AssertNoIssues();
|
||||
}));
|
||||
|
||||
Assert.Null(Record.Exception(() =>
|
||||
{
|
||||
var options = new TypeDeclarationAnalyzerOptions()
|
||||
{
|
||||
SdkAssembly = Assembly.GetAssembly(typeof(WechatWorkSpecialApiClient))!,
|
||||
SdkRequestModelDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models",
|
||||
SdkResponseModelDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi.Models",
|
||||
SdkExecutingExtensionDeclarationNamespace = "SKIT.FlurlHttpClient.Wechat.Work.ExtendedSDK.SpecialApi",
|
||||
ThrowOnNotFoundRequestModelTypes = true,
|
||||
ThrowOnNotFoundResponseModelTypes = true,
|
||||
ThrowOnNotFoundExecutingExtensionTypes = true
|
||||
};
|
||||
new TypeDeclarationAnalyzer(options).AssertNoIssues();
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"chatid": "wrjc7bDwAASxc8tZvBErFE02BtPWyAAA"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"agreeinfo": [
|
||||
{
|
||||
"status_change_time": 1562766651,
|
||||
"external_userid": "wmeDKaCQAAGdtHdiQWxVadfwV2HxNAAA",
|
||||
"agree_status": "Agree"
|
||||
},
|
||||
{
|
||||
"status_change_time": 1562766651,
|
||||
"external_userid": "wmeDKaCQAAIQ_p9ACyiopLBBJSGocAAA",
|
||||
"agree_status": "Disagree"
|
||||
},
|
||||
{
|
||||
"status_change_time": 1562766651,
|
||||
"external_userid": "wmeDKaCQAAIQ_p9ACnxacyBBJSGocAAA",
|
||||
"agree_status": "Agree"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"item": [
|
||||
{
|
||||
"open_userid": "XuJinSheng",
|
||||
"external_userid": "wmeDKaCQAAGd9oGiQWxVsAKwV2HxNAAA"
|
||||
},
|
||||
{
|
||||
"open_userid": "XuJinSheng",
|
||||
"external_userid": "wmeDKaCQAAIQ_p7ACn_jpLVBJSGocAAA"
|
||||
},
|
||||
{
|
||||
"open_userid": "XuJinSheng",
|
||||
"external_userid": "wmeDKaCQAAPE_p7ABnxkpLBBJSGocAAA"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"agreeinfo": [
|
||||
{
|
||||
"status_change_time": 1562766651,
|
||||
"open_userid": "XuJinSheng",
|
||||
"external_userid": "wmeDKaCPAAGdvxciQWxVsAKwV2HxNAAA",
|
||||
"agree_status": "Agree"
|
||||
},
|
||||
{
|
||||
"status_change_time": 1562766651,
|
||||
"open_userid": "XuJinSheng",
|
||||
"external_userid": "wmeDKaCQAAIQ_p7ACnxksfeBJSGocAAA",
|
||||
"agree_status": "Disagree"
|
||||
},
|
||||
{
|
||||
"status_change_time": 1562766651,
|
||||
"open_userid": "XuJinSheng",
|
||||
"external_userid": "wmeDKaCwAAIQ_p7ACnxckLBBJSGocAAA",
|
||||
"agree_status": "Agree"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"analyze_task": 1,
|
||||
"jobid": "JOBID",
|
||||
"msg_list": [
|
||||
{
|
||||
"msgid": "MSGID1",
|
||||
"encrypt_info": {
|
||||
"secret_key": "SECRETKEY1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"msgid": "MSGID2",
|
||||
"encrypt_info": {
|
||||
"secret_key": "SECRETKEY2"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"jobid": "JOBID",
|
||||
"fail_list": [
|
||||
{
|
||||
"errcode": 710601,
|
||||
"errmsg": "xxx",
|
||||
"msgid": "MSGID2"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"jobid": "JOBID"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"status": 1,
|
||||
"analyze_result": {
|
||||
"result_id": "RESULTID1",
|
||||
"service_encrypt_info": {
|
||||
"encrypted_secret_key": "KEYAAAAAAABBBBBB",
|
||||
"public_key_ver": 1
|
||||
}
|
||||
},
|
||||
"analyze_result_list": [
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"msgid": "MSGID1",
|
||||
"sentiment_result": 2,
|
||||
"spam_result": 1
|
||||
},
|
||||
{
|
||||
"errcode": 710601,
|
||||
"errmsg": "xxx",
|
||||
"msgid": "MSGID4"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"jobid": "JOBID"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"cursor": "JMgigeong",
|
||||
"limit": 2
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"auth_user_list": [
|
||||
{
|
||||
"open_userid": "woxxxjigegen",
|
||||
"edition_list": [ 1 ]
|
||||
},
|
||||
{
|
||||
"open_userid": "woaaaaaaaaaa",
|
||||
"edition_list": [ 1, 2, 3 ]
|
||||
}
|
||||
],
|
||||
"next_cursor": "xjigeojgeigwj",
|
||||
"has_more": true
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"chatid": "wrNplhCgAAIVZohLe57zKnvIV7xBKrig"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"creator": "woAAAAAAA",
|
||||
"room_create_time": 1592361604,
|
||||
"members": [
|
||||
{
|
||||
"memberid": "woAAAAAAAA",
|
||||
"jointime": 1592361605,
|
||||
"type": 1
|
||||
},
|
||||
{
|
||||
"memberid": "woBBBBBBBB",
|
||||
"jointime": 1592377076,
|
||||
"type": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt2JoW+P8uWG3ijm0fa4S\nVnnQ7fjcffaAoin3KEI6WykAz6+oNxFf+hSWX1cndPg8pMXZJGYhWMCXXgFLQXGv\naXSYEYxdCgbCDL2j0HmvzHEnLLgnY4jPYxoi7S9hQbJVB+nnci9U8wUD//s5YSiY\nAjDLMwwLlE29VPNp6GCw3oVRseKl3kKnlrifxUgJv3BVgCcgpDT5LMwrsAV2gYR1\nolyINpA9LgWesSjSQPydBtaI5CmHTB1Fm1Xcr3OEFmSCoi6hdqFJXclDCRyTJqHQ\n4U1RuCVK8ahfzqoapc53H3kWkOzplhcBxEV/S1voaxScKbX5TuYm4A97fS6ok+sr\nUQIDAQAB\n-----END PUBLIC KEY-----\n",
|
||||
"public_key_ver": 1
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"cursor": "RMTJID",
|
||||
"token": "NGEJKGOEGJKOEGNEOAGOEGOKEGHOEEEEE",
|
||||
"limit": 200
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"has_more": true,
|
||||
"next_cursor": "JGNLGEHJGIE",
|
||||
"msg_list": [
|
||||
{
|
||||
"msgid": "xxxmsgid",
|
||||
"sender": {
|
||||
"type": 1,
|
||||
"id": "woxxxxxmmgjiegjie"
|
||||
},
|
||||
"receiver_list": [
|
||||
{
|
||||
"type": 1,
|
||||
"id": "woAAAAAAAAAAA"
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"id": "wmXXXXXXXXXXXXX"
|
||||
}
|
||||
],
|
||||
"chatid": "wrXXXXXXXXXX",
|
||||
"send_time": 166666666,
|
||||
"msgtype": 2,
|
||||
"service_encrypt_info": {
|
||||
"encrypted_secret_key": "KEYAAAAAAABBBBBB",
|
||||
"public_key_ver": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"code": "xxxxx",
|
||||
"media_id": "xxxxx"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"jobid": "xxxxx"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user