feat(work): 封装部分企业微信接口

This commit is contained in:
Fu Diwei
2021-06-07 00:23:28 +08:00
parent b785ee8a83
commit a397821baa
50 changed files with 1172 additions and 38 deletions

View File

@@ -25,8 +25,8 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (!request.AgentId.HasValue)
request.AgentId = client.AgentId;
if (!request.ParentAgentId.HasValue)
request.ParentAgentId = client.AgentId;
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Post, "cgi-bin", "corpgroup", "corp", "list_app_share_info")

View File

@@ -25,7 +25,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Get, "cgi-bin", "token")
.CreateRequest(HttpMethod.Get, "cgi-bin", "gettoken")
.SetOptions(request)
.SetQueryParam("corpid", client.CorpId)
.SetQueryParam("corpsecret", client.AgentSecret);
@@ -75,5 +75,50 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
return await client.SendRequestAsync<Models.CgibinGetApiDomainIpResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /cgi-bin/get_jsapi_ticket 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90136/90506 </para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90144/90539 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinGetJsapiTicketResponse> ExecuteCgibinGetJsapiTicketAsync(this WechatWorkClient client, Models.CgibinGetJsapiTicketRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Get, "cgi-bin", "get_jsapi_ticket")
.SetOptions(request)
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestAsync<Models.CgibinGetJsapiTicketResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [GET] /cgi-bin/ticket/get 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90136/90506 </para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90144/90539 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinTicketGetResponse> ExecuteCgibinTicketGetAsync(this WechatWorkClient client, Models.CgibinTicketGetRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Get, "cgi-bin", "ticket", "get")
.SetOptions(request)
.SetQueryParam("access_token", request.AccessToken)
.SetQueryParam("type", request.Type);
return await client.SendRequestAsync<Models.CgibinTicketGetResponse>(flurlReq, cancellationToken: cancellationToken);
}
}
}

View File

@@ -0,0 +1,124 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Flurl;
using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.Work
{
public static class WechatWorkClientExecuteCgibinExternalPayExtensions
{
#region Merchant
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/externalpay/addmerchant 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93666 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinExternalPayAddMerchantResponse> ExecuteCgibinExternalPayAddMerchantAsync(this WechatWorkClient client, Models.CgibinExternalPayAddMerchantRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Post, "cgi-bin", "externalpay", "addmerchant")
.SetOptions(request)
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinExternalPayAddMerchantResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/externalpay/getmerchant 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93666 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinExternalPayGetMerchantResponse> ExecuteCgibinExternalPayGetMerchantAsync(this WechatWorkClient client, Models.CgibinExternalPayGetMerchantRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Post, "cgi-bin", "externalpay", "getmerchant")
.SetOptions(request)
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinExternalPayGetMerchantResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/externalpay/delmerchant 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93666 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinExternalPayDeleteMerchantResponse> ExecuteCgibinExternalPayDeleteMerchantAsync(this WechatWorkClient client, Models.CgibinExternalPayDeleteMerchantRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Post, "cgi-bin", "externalpay", "delmerchant")
.SetOptions(request)
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinExternalPayDeleteMerchantResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/externalpay/set_mch_use_scope 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93666 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinExternalPaySetMerchantUseScopeResponse> ExecuteCgibinExternalPaySetMerchantUseScopeAsync(this WechatWorkClient client, Models.CgibinExternalPaySetMerchantUseScopeRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Post, "cgi-bin", "externalpay", "set_mch_use_scope")
.SetOptions(request)
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinExternalPaySetMerchantUseScopeResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Bill
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/externalpay/get_bill_list 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90135/93667 </para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/93727 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinExternalPayGetBillListResponse> ExecuteCgibinExternalPayGetBillListAsync(this WechatWorkClient client, Models.CgibinExternalPayGetBillListRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Post, "cgi-bin", "externalpay", "get_bill_list")
.SetOptions(request)
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinExternalPayGetBillListResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
}
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -263,7 +264,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Get, "cgi-bin", "service", "get_register_code")
.CreateRequest(HttpMethod.Post, "cgi-bin", "service", "get_register_code")
.SetOptions(request)
.SetQueryParam("provider_access_token", request.AccessToken);
@@ -284,12 +285,144 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Get, "cgi-bin", "service", "get_register_info")
.CreateRequest(HttpMethod.Post, "cgi-bin", "service", "get_register_info")
.SetOptions(request)
.SetQueryParam("provider_access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinServiceGetRegisterInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Media
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/service/media/upload 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/91883 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinServiceMediaUploadResponse> ExecuteCgibinServiceMediaUploadAsync(this WechatWorkClient client, Models.CgibinServiceMediaUploadRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
if (string.IsNullOrEmpty(request.FileName))
{
string ext = "";
if ("image".Equals(request.Type))
ext = ".png";
else if ("voice".Equals(request.Type))
ext = ".mp3";
else if ("video".Equals(request.Type))
ext = ".mp4";
request.FileName = Guid.NewGuid().ToString("N").ToLower() + ext;
}
if (string.IsNullOrEmpty(request.FileContentType))
{
if (request.FileName!.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase))
request.FileContentType = "image/jpeg";
else if (request.FileName!.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase))
request.FileContentType = "image/jpeg";
else if (request.FileName!.EndsWith(".png", StringComparison.OrdinalIgnoreCase))
request.FileContentType = "image/png";
else if (request.FileName!.EndsWith(".gif", StringComparison.OrdinalIgnoreCase))
request.FileContentType = "image/gif";
else if (request.FileName!.EndsWith(".mp3", StringComparison.OrdinalIgnoreCase))
request.FileContentType = "audio/mpeg";
else if (request.FileName!.EndsWith(".amr", StringComparison.OrdinalIgnoreCase))
request.FileContentType = "audio/amr";
else if (request.FileName!.EndsWith(".mp4", StringComparison.OrdinalIgnoreCase))
request.FileContentType = "video/mp4";
else
request.FileContentType = "application/octet-stream";
}
string boundary = "--BOUNDARY--" + DateTimeOffset.Now.Ticks.ToString("x");
using var fileContent = new ByteArrayContent(request.FileBytes ?? new byte[0]);
using var httpContent = new MultipartFormDataContent(boundary);
httpContent.Add(fileContent, "\"media\"", "\"" + request.FileName + "\"");
httpContent.Headers.ContentType = MediaTypeHeaderValue.Parse("multipart/form-data; boundary=" + boundary);
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse(request.FileContentType);
fileContent.Headers.ContentLength = request.FileBytes?.Length;
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Post, "cgi-bin", "service", "media", "upload")
.SetOptions(request)
.SetQueryParam("provider_access_token", request.AccessToken)
.SetQueryParam("type", request.Type);
return await client.SendRequestAsync<Models.CgibinServiceMediaUploadResponse>(flurlReq, content: httpContent, cancellationToken: cancellationToken);
}
#endregion
#region Contact
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/service/contact/id_translate 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/91846 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinServiceContactIdTranslateResponse> ExecuteCgibinServiceContactIdTranslateAsync(this WechatWorkClient client, Models.CgibinServiceContactIdTranslateRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Post, "cgi-bin", "service", "contact", "id_translate")
.SetOptions(request)
.SetQueryParam("provider_access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinServiceContactIdTranslateResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/service/contact/sort 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/92093 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinServiceContactSortResponse> ExecuteCgibinServiceContactSortAsync(this WechatWorkClient client, Models.CgibinServiceContactSortRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Post, "cgi-bin", "service", "contact", "sort")
.SetOptions(request)
.SetQueryParam("provider_access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinServiceContactSortResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
}
#endregion
#region Batch
/// <summary>
/// <para>异步调用 [GET] /cgi-bin/service/batch/getresult 接口。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90143/91882 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinServiceBatchGetResultResponse> ExecuteCgibinServiceBatchGetResultAsync(this WechatWorkClient client, Models.CgibinServiceBatchGetResultRequest request, CancellationToken cancellationToken = default)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (request is null) throw new ArgumentNullException(nameof(request));
IFlurlRequest flurlReq = client
.CreateRequest(HttpMethod.Get, "cgi-bin", "service", "batch", "getresult")
.SetOptions(request)
.SetQueryParam("provider_access_token", request.AccessToken)
.SetQueryParam("jobid", request.JobId);
return await client.SendRequestAsync<Models.CgibinServiceBatchGetResultResponse>(flurlReq, cancellationToken: cancellationToken);
}
#endregion
}
}

View File

@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using Flurl;
using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.Work
{
/// <summary>
/// 为 <see cref="WechatWorkClient"/> 提供客户端调起 JS-SDK 签名的扩展方法。
/// </summary>
public static class WechatWorkClientParameterExtensions
{
/// <summary>
/// <para>生成客户端 JS-SDK `wx.config` 所需的参数。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90136/90506 </para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90144/90539 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="jsapiTicket"></param>
/// <param name="url"></param>
/// <returns></returns>
public static IDictionary<string, string> GenerateParametersForJssdkConfigRequest(this WechatWorkClient client, string jsapiTicket, string url)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (jsapiTicket is null) throw new ArgumentNullException(nameof(jsapiTicket));
if (url is null) throw new ArgumentNullException(nameof(url));
string timestamp = DateTimeOffset.Now.ToLocalTime().ToUnixTimeSeconds().ToString();
string nonce = Guid.NewGuid().ToString("N");
string sign = Security.SHA1Utility.Hash($"jsapi_ticket={jsapiTicket}&noncestr={nonce}&timestamp={timestamp}&url={url.Split('#')[0]}").ToLower();
return new ReadOnlyDictionary<string, string>(new Dictionary<string, string>()
{
{ "appId", client.CorpId },
{ "timestamp", timestamp },
{ "nonceStr", nonce },
{ "signature", sign }
});
}
/// <summary>
/// <para>生成客户端 JS-SDK `wx.agentConfig` 所需的参数。</para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90000/90136/90506 </para>
/// <para>REF: https://open.work.weixin.qq.com/api/doc/90001/90144/90539 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="jsapiTicket"></param>
/// <param name="url"></param>
/// <returns></returns>
public static IDictionary<string, string> GenerateParametersForJssdkAgentConfigRequest(this WechatWorkClient client, string jsapiTicket, string url)
{
if (client is null) throw new ArgumentNullException(nameof(client));
if (jsapiTicket is null) throw new ArgumentNullException(nameof(jsapiTicket));
if (url is null) throw new ArgumentNullException(nameof(url));
string timestamp = DateTimeOffset.Now.ToLocalTime().ToUnixTimeSeconds().ToString();
string nonce = Guid.NewGuid().ToString("N");
string sign = Security.SHA1Utility.Hash($"jsapi_ticket={jsapiTicket}&noncestr={nonce}&timestamp={timestamp}&url={url.Split('#')[0]}").ToLower();
return new ReadOnlyDictionary<string, string>(new Dictionary<string, string>()
{
{ "corpid", client.CorpId },
{ "agentid", client.AgentId?.ToString() ?? string.Empty },
{ "timestamp", timestamp },
{ "nonceStr", nonce },
{ "signature", sign }
});
}
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [GET] /cgi-bin/get_jsapi_ticket 接口的请求。</para>
/// </summary>
public class CgibinGetJsapiTicketRequest : WechatWorkRequest
{
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [GET] /cgi-bin/get_jsapi_ticket 接口的响应。</para>
/// </summary>
public class CgibinGetJsapiTicketResponse : WechatWorkResponse
{
/// <summary>
/// 获取或设置票据。
/// </summary>
[Newtonsoft.Json.JsonProperty("ticket")]
[System.Text.Json.Serialization.JsonPropertyName("ticket")]
public string Ticket { get; set; } = default!;
/// <summary>
/// 获取或设置票据有效期(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
public int ExpiresIn { get; set; }
}
}

View File

@@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string AccessToken { get; set; } = default!;
/// <summary>
/// 获取或设置凭证有效时间(单位:秒)。
/// 获取或设置凭证有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [GET] /cgi-bin/ticket/get 接口的请求。</para>
/// </summary>
public class CgibinTicketGetRequest : CgibinGetJsapiTicketRequest
{
/// <summary>
/// <para>获取或设置票据类型。</para>
/// <para>默认值agent_config</para>
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string Type { get; set; } = "agent_config";
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [GET] /cgi-bin/ticket/get 接口的响应。</para>
/// </summary>
public class CgibinTicketGetResponse : CgibinGetJsapiTicketResponse
{
}
}

View File

@@ -38,7 +38,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("userlist")]
[System.Text.Json.Serialization.JsonPropertyName("userlist")]
public IList<string> MemberUserIdList { get; set; } = default!;
public string[] MemberUserIdList { get; set; } = default!;
}
}

View File

@@ -173,6 +173,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("ThirdNo")]
[System.Text.Json.Serialization.JsonPropertyName("ThirdNo")]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Converters.NumberTypedStringConverter))]
public string ThirdPartyApprovalNumber { get; set; } = default!;
/// <summary>

View File

@@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string AccessToken { get; set; } = default!;
/// <summary>
/// 获取或设置下级企业 AccessToken 有效时间(单位:秒)。
/// 获取或设置下级企业 AccessToken 有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]

View File

@@ -13,6 +13,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("agentid")]
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
public int? AgentId { get; set; }
public int? ParentAgentId { get; set; }
}
}

View File

@@ -169,7 +169,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("group_name")]
[System.Text.Json.Serialization.JsonPropertyName("group_name")]
public string? GroupName { get; set; }
public string? TagGroupName { get; set; }
}
}

View File

@@ -191,14 +191,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public bool? IsTemp { get; set; }
/// <summary>
/// 获取或设置临时会话二维码有效时间(单位:秒)。
/// 获取或设置临时会话二维码有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
public int? TempQrcodeExpiresIn { get; set; }
/// <summary>
/// 获取或设置临时会话有效时间有效时间(单位:秒)。
/// 获取或设置临时会话有效时间有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("chat_expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("chat_expires_in")]

View File

@@ -209,14 +209,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public bool IsTemp { get; set; } = default!;
/// <summary>
/// 获取或设置临时会话二维码有效时间(单位:秒)。
/// 获取或设置临时会话二维码有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
public int? TempQrcodeExpiresIn { get; set; }
/// <summary>
/// 获取或设置临时会话有效时间有效时间(单位:秒)。
/// 获取或设置临时会话有效时间有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("chat_expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("chat_expires_in")]

View File

@@ -72,14 +72,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public bool? IsTemp { get; set; }
/// <summary>
/// 获取或设置临时会话二维码有效时间(单位:秒)。
/// 获取或设置临时会话二维码有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]
public int? TempQrcodeExpiresIn { get; set; }
/// <summary>
/// 获取或设置临时会话有效时间有效时间(单位:秒)。
/// 获取或设置临时会话有效时间有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("chat_expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("chat_expires_in")]

View File

@@ -17,7 +17,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string Name { get; set; } = default!;
public string Name { get; set; } = string.Empty;
/// <summary>
/// 获取或设置次序值。
@@ -33,7 +33,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("group_id")]
[System.Text.Json.Serialization.JsonPropertyName("group_id")]
public string? GroupId { get; set; }
public string? TagGroupId { get; set; }
/// <summary>
/// 获取或设置企业标签分组名称。

View File

@@ -20,6 +20,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("tag_group")]
[System.Text.Json.Serialization.JsonPropertyName("tag_group")]
public Types.TagGroup Group { get; set; } = default!;
public Types.TagGroup TagGroup { get; set; } = default!;
}
}

View File

@@ -20,6 +20,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("group_id")]
[System.Text.Json.Serialization.JsonPropertyName("group_id")]
public IList<string>? GroupIdList { get; set; }
public IList<string>? TagGroupIdList { get; set; }
}
}

View File

@@ -58,7 +58,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("group_id")]
[System.Text.Json.Serialization.JsonPropertyName("group_id")]
public string GroupId { get; set; } = default!;
public string TagGroupId { get; set; } = default!;
/// <summary>
/// 获取或设置企业标签分组名称。
@@ -102,6 +102,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("tag_group")]
[System.Text.Json.Serialization.JsonPropertyName("tag_group")]
public Types.TagGroup[] GroupList { get; set; } = default!;
public Types.TagGroup[] TagGroupList { get; set; } = default!;
}
}

View File

@@ -58,7 +58,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public Types.Invitor? Invitor { get; set; }
/// <summary>
/// 获取或设置入群场景。
/// 获取或设置入群场景
/// </summary>
[Newtonsoft.Json.JsonProperty("join_scene")]
[System.Text.Json.Serialization.JsonPropertyName("join_scene")]

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/get_bill_list 接口的请求。</para>
/// </summary>
public class CgibinExternalPayGetBillListRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置指定收款记录开始时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("begin_time")]
[System.Text.Json.Serialization.JsonPropertyName("begin_time")]
public long BeginTimestamp { 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("payee_userid")]
[System.Text.Json.Serialization.JsonPropertyName("payee_userid")]
public string? PayeeUserId { get; set; }
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("cursor")]
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
public string? NextCursor { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int? Limit { get; set; }
}
}

View File

@@ -0,0 +1,218 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/get_bill_list 接口的响应。</para>
/// </summary>
public class CgibinExternalPayGetBillListResponse : WechatWorkResponse
{
public static class Types
{
public class Bill
{
public static class Types
{
public class Commodity
{
/// <summary>
/// 获取或设置商品描述。
/// </summary>
[Newtonsoft.Json.JsonProperty("description")]
[System.Text.Json.Serialization.JsonPropertyName("description")]
public string Description { get; set; } = default!;
/// <summary>
/// 获取或设置商品数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("amount")]
[System.Text.Json.Serialization.JsonPropertyName("amount")]
public int? Count { get; set; }
}
public class Refund
{
/// <summary>
/// 获取或设置商户退款单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_refund_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_refund_no")]
public string OutRefundNumber { get; set; } = default!;
/// <summary>
/// 获取或设置退款发起人成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("refund_userid")]
[System.Text.Json.Serialization.JsonPropertyName("refund_userid")]
public string RefundUserId { get; set; } = default!;
/// <summary>
/// 获取或设置退款备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("refund_comment")]
[System.Text.Json.Serialization.JsonPropertyName("refund_comment")]
public string RefundComment { get; set; } = default!;
/// <summary>
/// 获取或设置退款发起时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("refund_reqtime")]
[System.Text.Json.Serialization.JsonPropertyName("refund_reqtime")]
public long RefundRequestTimestamp { get; set; }
/// <summary>
/// 获取或设置退款状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("refund_status")]
[System.Text.Json.Serialization.JsonPropertyName("refund_status")]
public int RefundStatus { get; set; }
/// <summary>
/// 获取或设置退款金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("refund_fee")]
[System.Text.Json.Serialization.JsonPropertyName("refund_fee")]
public int RefundFee { get; set; }
}
public class Contact
{
/// <summary>
/// 获取或设置姓名。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string? Name { get; set; }
/// <summary>
/// 获取或设置电话号码。
/// </summary>
[Newtonsoft.Json.JsonProperty("phone")]
[System.Text.Json.Serialization.JsonPropertyName("phone")]
public string? PhoneNumber { get; set; }
/// <summary>
/// 获取或设置地址。
/// </summary>
[Newtonsoft.Json.JsonProperty("address")]
[System.Text.Json.Serialization.JsonPropertyName("address")]
public string? Address { get; set; }
}
}
/// <summary>
/// 获取或设置微信支付商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mch_id")]
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置商户单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("out_trade_no")]
[System.Text.Json.Serialization.JsonPropertyName("out_trade_no")]
public string OutTradeNumber { get; set; } = default!;
/// <summary>
/// 获取或设置交易单号。
/// </summary>
[Newtonsoft.Json.JsonProperty("transaction_id")]
[System.Text.Json.Serialization.JsonPropertyName("transaction_id")]
public string TransactionId { get; set; } = default!;
/// <summary>
/// 获取或设置交易状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("trade_state")]
[System.Text.Json.Serialization.JsonPropertyName("trade_state")]
public int TradeState { get; set; }
/// <summary>
/// 获取或设置付款人外部联系人账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("external_userid")]
[System.Text.Json.Serialization.JsonPropertyName("external_userid")]
public string PayerExternalUserId { get; set; } = default!;
/// <summary>
/// 获取或设置收款人成员账号。
/// </summary>
[Newtonsoft.Json.JsonProperty("payee_userid")]
[System.Text.Json.Serialization.JsonPropertyName("payee_userid")]
public string PayeeUserId { get; set; } = default!;
/// <summary>
/// 获取或设置总金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_fee")]
[System.Text.Json.Serialization.JsonPropertyName("total_fee")]
public int TotalFee { get; set; }
/// <summary>
/// 获取或设置已退款金额(单位:分)。
/// </summary>
[Newtonsoft.Json.JsonProperty("total_refund_fee")]
[System.Text.Json.Serialization.JsonPropertyName("total_refund_fee")]
public int RefundFee { get; set; }
/// <summary>
/// 获取或设置收款方式。
/// </summary>
[Newtonsoft.Json.JsonProperty("payment_type")]
[System.Text.Json.Serialization.JsonPropertyName("payment_type")]
public int PaymentType { get; set; }
/// <summary>
/// 获取或设置交易时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("pay_time")]
[System.Text.Json.Serialization.JsonPropertyName("pay_time")]
public long PayTimestamp { get; set; }
/// <summary>
/// 获取或设置备注。
/// </summary>
[Newtonsoft.Json.JsonProperty("remark")]
[System.Text.Json.Serialization.JsonPropertyName("remark")]
public string Remark { get; set; } = default!;
/// <summary>
/// 获取或设置联系人信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("payer_info")]
[System.Text.Json.Serialization.JsonPropertyName("payer_info")]
public Types.Contact? Contact { get; set; }
/// <summary>
/// 获取或设置商品列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("commodity_list")]
[System.Text.Json.Serialization.JsonPropertyName("commodity_list")]
public Types.Commodity[]? CommodityList { get; set; }
/// <summary>
/// 获取或设置退款列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("refund_list")]
[System.Text.Json.Serialization.JsonPropertyName("refund_list")]
public Types.Refund[]? RefundList { get; set; }
}
}
/// <summary>
/// 获取或设置交易单列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("bill_list")]
[System.Text.Json.Serialization.JsonPropertyName("bill_list")]
public Types.Bill[] BillList { get; set; } = default!;
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("next_cursor")]
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
public string? NextCursor { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/addmerchant 接口的请求。</para>
/// </summary>
public class CgibinExternalPayAddMerchantRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置微信支付商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mch_id")]
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
public string MerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置微信支付商户号全称。
/// </summary>
[Newtonsoft.Json.JsonProperty("merchant_name")]
[System.Text.Json.Serialization.JsonPropertyName("merchant_name")]
public string MerchantName { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/addmerchant 接口的响应。</para>
/// </summary>
public class CgibinExternalPayAddMerchantResponse : WechatWorkResponse
{
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/delmerchant 接口的请求。</para>
/// </summary>
public class CgibinExternalPayDeleteMerchantRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置微信支付商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mch_id")]
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
public string MerchantId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/delmerchant 接口的响应。</para>
/// </summary>
public class CgibinExternalPayDeleteMerchantResponse : WechatWorkResponse
{
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/getmerchant 接口的请求。</para>
/// </summary>
public class CgibinExternalPayGetMerchantRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置微信支付商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mch_id")]
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
public string MerchantId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/getmerchant 接口的响应。</para>
/// </summary>
public class CgibinExternalPayGetMerchantResponse : WechatWorkResponse
{
public static class Types
{
public class UseScope
{
/// <summary>
/// 获取或设置成员账号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("user")]
[System.Text.Json.Serialization.JsonPropertyName("user")]
public string[]? UserIdList { get; set; }
/// <summary>
/// 获取或设置部门 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("partyid")]
[System.Text.Json.Serialization.JsonPropertyName("partyid")]
public int[]? DepartmentIdList { get; set; }
/// <summary>
/// 获取或设置标签 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("tagid")]
[System.Text.Json.Serialization.JsonPropertyName("tagid")]
public int[]? TagIdList { get; set; }
}
}
/// <summary>
/// 获取或设置绑定状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("bind_status")]
[System.Text.Json.Serialization.JsonPropertyName("bind_status")]
public int BindStatus { get; set; }
/// <summary>
/// 获取或设置微信支付商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mch_id")]
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
public string MerchantId { get; set; } = default!;
/// <summary>
/// 获取或设置微信支付商户号全称。
/// </summary>
[Newtonsoft.Json.JsonProperty("merchant_name")]
[System.Text.Json.Serialization.JsonPropertyName("merchant_name")]
public string MerchantName { get; set; } = default!;
/// <summary>
/// 获取或设置使用范围信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("allow_use_scope")]
[System.Text.Json.Serialization.JsonPropertyName("allow_use_scope")]
public Types.UseScope? UseScope { get; set; }
}
}

View File

@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/set_mch_use_scope 接口的请求。</para>
/// </summary>
public class CgibinExternalPaySetMerchantUseScopeRequest : WechatWorkRequest
{
public static class Types
{
public class UseScope
{
/// <summary>
/// 获取或设置成员账号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("user")]
[System.Text.Json.Serialization.JsonPropertyName("user")]
public IList<string>? UserIdList { get; set; }
/// <summary>
/// 获取或设置部门 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("partyid")]
[System.Text.Json.Serialization.JsonPropertyName("partyid")]
public IList<int>? DepartmentIdList { get; set; }
/// <summary>
/// 获取或设置标签 ID 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("tagid")]
[System.Text.Json.Serialization.JsonPropertyName("tagid")]
public IList<int>? TagIdList { get; set; }
}
}
/// <summary>
/// 获取或设置微信支付商户号。
/// </summary>
[Newtonsoft.Json.JsonProperty("mch_id")]
[System.Text.Json.Serialization.JsonPropertyName("mch_id")]
public string MerchantId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置使用范围信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("allow_use_scope")]
[System.Text.Json.Serialization.JsonPropertyName("allow_use_scope")]
public Types.UseScope UseScope { get; set; } = new Types.UseScope();
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/externalpay/set_mch_use_scope 接口的响应。</para>
/// </summary>
public class CgibinExternalPaySetMerchantUseScopeResponse : WechatWorkResponse
{
}
}

View File

@@ -174,28 +174,28 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("members")]
[System.Text.Json.Serialization.JsonPropertyName("members")]
public IList<ContactControlValueForUser>? ContactMembers { get; set; }
public ContactControlValueForUser[]? ContactMembers { get; set; }
/// <summary>
/// 获取或设置 Contact 控件部门值。
/// </summary>
[Newtonsoft.Json.JsonProperty("departments")]
[System.Text.Json.Serialization.JsonPropertyName("departments")]
public IList<ContactControlValueForDepartment>? ContactDepartments { get; set; }
public ContactControlValueForDepartment[]? ContactDepartments { get; set; }
/// <summary>
/// 获取或设置 File 控件值。
/// </summary>
[Newtonsoft.Json.JsonProperty("files")]
[System.Text.Json.Serialization.JsonPropertyName("files")]
public IList<FileControlValue>? Files { get; set; }
public FileControlValue[]? Files { get; set; }
/// <summary>
/// 获取或设置 Table 控件值。
/// </summary>
[Newtonsoft.Json.JsonProperty("children")]
[System.Text.Json.Serialization.JsonPropertyName("children")]
public IList<TableControlValue>? TableChildren { get; set; }
public TableControlValue[]? TableChildren { get; set; }
/// <summary>
/// 获取或设置 Attendance 控件值。
@@ -223,7 +223,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("related_approval")]
[System.Text.Json.Serialization.JsonPropertyName("related_approval")]
public IList<RelatedApprovalControlValue>? RelatedApprovals { get; set; }
public RelatedApprovalControlValue[]? RelatedApprovals { get; set; }
/// <summary>
/// 获取或设置 Formula 控件值。
@@ -753,14 +753,14 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
/// </summary>
[Newtonsoft.Json.JsonProperty("sp_record")]
[System.Text.Json.Serialization.JsonPropertyName("sp_record")]
public IList<Types.Record> RecordList { get; set; } = default!;
public Types.Record[] RecordList { get; set; } = default!;
/// <summary>
/// 获取或设置评论列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("comments")]
[System.Text.Json.Serialization.JsonPropertyName("comments")]
public IList<Types.Comment> CommentList { get; set; } = default!;
public Types.Comment[] CommentList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [GET] /cgi-bin/service/batch/getresult 接口的请求。</para>
/// </summary>
public class CgibinServiceBatchGetResultRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置异步任务 ID。
/// </summary>
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string JobId { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [GET] /cgi-bin/service/batch/getresult 接口的响应。</para>
/// </summary>
public class CgibinServiceBatchGetResultResponse : WechatWorkResponse
{
public static class Types
{
public class Result
{
public static class Types
{
public class ContactIdTranslateResult
{
/// <summary>
/// 获取或设置 URL。
/// </summary>
[Newtonsoft.Json.JsonProperty("url")]
[System.Text.Json.Serialization.JsonPropertyName("url")]
public string Url { get; set; } = default!;
}
}
/// <summary>
/// 获取或设置通讯录 ID 转译任务结果。
/// </summary>
[Newtonsoft.Json.JsonProperty("contact_id_translate")]
[System.Text.Json.Serialization.JsonPropertyName("contact_id_translate")]
public Types.ContactIdTranslateResult? ContactIdTranslateResult { get; set; }
}
}
/// <summary>
/// 获取或设置任务类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("type")]
[System.Text.Json.Serialization.JsonPropertyName("type")]
public string Type { get; set; } = default!;
/// <summary>
/// 获取或设置任务状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("status")]
[System.Text.Json.Serialization.JsonPropertyName("status")]
public int Status { get; set; }
/// <summary>
/// 获取或设置处理结果。
/// </summary>
[Newtonsoft.Json.JsonProperty("result")]
[System.Text.Json.Serialization.JsonPropertyName("result")]
public Types.Result Result { get; set; } = default!;
}
}

View File

@@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string AccessToken { get; set; } = default!;
/// <summary>
/// 获取或设置授权方凭证有效时间(单位:秒)。
/// 获取或设置授权方凭证有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]

View File

@@ -99,7 +99,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string AccessToken { get; set; } = default!;
/// <summary>
/// 获取或设置授权方凭证有效时间(单位:秒)。
/// 获取或设置授权方凭证有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]

View File

@@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string PreAuthCode { get; set; } = default!;
/// <summary>
/// 获取或设置预授权码有效时间(单位:秒)。
/// 获取或设置预授权码有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]

View File

@@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string ProviderAccessToken { get; set; } = default!;
/// <summary>
/// 获取或设置服务商凭证有效时间(单位:秒)。
/// 获取或设置服务商凭证有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]

View File

@@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string SuiteAccessToken { get; set; } = default!;
/// <summary>
/// 获取或设置第三方应用凭证有效时间(单位:秒)。
/// 获取或设置第三方应用凭证有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]

View File

@@ -51,7 +51,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string? UserTicket { get; set; }
/// <summary>
/// 获取或设置成员票据有效时间(单位:秒)。
/// 获取或设置成员票据有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/service/contact/id_translate 接口的请求。</para>
/// </summary>
public class CgibinServiceContactIdTranslateRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置授权方 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("auth_corpid")]
[System.Text.Json.Serialization.JsonPropertyName("auth_corpid")]
public string AuthorizerCorpId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置需要转译的文件 MediaId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("media_id_list")]
[System.Text.Json.Serialization.JsonPropertyName("media_id_list")]
public IList<string> MediaIdList { get; set; } = new List<string>();
/// <summary>
/// 获取或设置转译后打包的文件名(不带后缀名)。
/// </summary>
[Newtonsoft.Json.JsonProperty("output_file_name")]
[System.Text.Json.Serialization.JsonPropertyName("output_file_name")]
public string? OutputFileName { get; set; }
/// <summary>
/// 获取或设置转译后打包的文件格式。
/// </summary>
[Newtonsoft.Json.JsonProperty("output_file_format")]
[System.Text.Json.Serialization.JsonPropertyName("output_file_format")]
public string? OutputFileFormat { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/service/contact/id_translate 接口的响应。</para>
/// </summary>
public class CgibinServiceContactIdTranslateResponse : WechatWorkResponse
{
/// <summary>
/// 获取或设置异步任务 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("jobid")]
[System.Text.Json.Serialization.JsonPropertyName("jobid")]
public string JobId { get; set; } = default!;
}
}

View File

@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/service/contact/sort 接口的请求。</para>
/// </summary>
public class CgibinServiceContactSortRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置授权方 CorpId。
/// </summary>
[Newtonsoft.Json.JsonProperty("auth_corpid")]
[System.Text.Json.Serialization.JsonPropertyName("auth_corpid")]
public string AuthorizerCorpId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置排序方式。
/// </summary>
[Newtonsoft.Json.JsonProperty("sort_type")]
[System.Text.Json.Serialization.JsonPropertyName("sort_type")]
public int SortType { get; set; }
/// <summary>
/// 获取或设置要排序的成员账号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("useridlist")]
[System.Text.Json.Serialization.JsonPropertyName("useridlist")]
public IList<string> UserIdList { get; set; } = new List<string>();
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/service/contact/sort 接口的响应。</para>
/// </summary>
public class CgibinServiceContactSortResponse : WechatWorkResponse
{
/// <summary>
/// 获取或设置排序后的成员账号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("useridlist")]
[System.Text.Json.Serialization.JsonPropertyName("useridlist")]
public string[] UserIdList { get; set; } = default!;
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/service/media/upload 接口的请求。</para>
/// </summary>
public class CgibinServiceMediaUploadRequest : CgibinMediaUploadRequest
{
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/service/media/upload 接口的响应。</para>
/// </summary>
public class CgibinServiceMediaUploadResponse : CgibinMediaUploadResponse
{
}
}

View File

@@ -16,7 +16,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string RegisterCode { get; set; } = default!;
/// <summary>
/// 获取或设置注册码有效时间(单位:秒)。
/// 获取或设置注册码有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]

View File

@@ -20,7 +20,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
public string AccessToken { get; set; } = default!;
/// <summary>
/// 获取或设置通讯录迁移凭证有效时间(单位:秒)。
/// 获取或设置通讯录迁移凭证有效(单位:秒)。
/// </summary>
[Newtonsoft.Json.JsonProperty("expires_in")]
[System.Text.Json.Serialization.JsonPropertyName("expires_in")]