feat(wxapi): 新增小程序用工关系相关接口

This commit is contained in:
Fu Diwei
2025-11-27 15:36:33 +08:00
parent a9759a0cea
commit 34dbea382b
9 changed files with 131 additions and 0 deletions

View File

@@ -80,6 +80,7 @@
| √ | 插件管理 | | |
| √ | 云开发 | | |
| √ | 附近小程序 | | |
| √ | 用工关系 | | |
| √ | 图像处理与文字识别 | | |
| √ | 微信红包封面 | | |
| √ | 即时配送 | | |

View File

@@ -79,5 +79,28 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinMessageWxopenUpdatableMessageSendResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/message/wxopen/employeerelationmsg/send 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/laboruse/api_sendemployeerelationmsg.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinMessageWxopenEmployeeRelationMessageSendResponse> ExecuteCgibinMessageWxopenEmployeeRelationMessageSendAsync(this WechatApiClient client, Models.CgibinMessageWxopenEmployeeRelationMessageSendRequest 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", "message", "wxopen", "employeerelationmsg", "send")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinMessageWxopenEmployeeRelationMessageSendResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
}
}

View File

@@ -128,6 +128,31 @@ namespace SKIT.FlurlHttpClient.Wechat.Api
}
#endregion
#region B2CAuth
/// <summary>
/// <para>异步调用 [POST] /wxa/business/unbinduserb2cauthinfo 接口。</para>
/// <para>
/// REF: <br/>
/// <![CDATA[ https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/laboruse/api_unbinduserb2cauthinfo.html ]]>
/// </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.WxaBusinessUnbindUserB2CAuthInfoResponse> ExecuteWxaBusinessUnbindUserB2CAuthInfoAsync(this WechatApiClient client, Models.WxaBusinessUnbindUserB2CAuthInfoRequest 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, "wxa", "business", "unbinduserb2cauthinfo")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendFlurlRequestAsJsonAsync<Models.WxaBusinessUnbindUserB2CAuthInfoResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
}
#endregion
#region GameMatch
/// <summary>
/// <para>异步调用 [POST] /wxa/business/gamematch/creatematchrule 接口。</para>

View File

@@ -0,0 +1,36 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/message/wxopen/employeerelationmsg/send 接口的请求。</para>
/// </summary>
public class CgibinMessageWxopenEmployeeRelationMessageSendRequest : WechatApiRequest, IInferable<CgibinMessageWxopenEmployeeRelationMessageSendRequest, CgibinMessageWxopenEmployeeRelationMessageSendResponse>
{
/// <summary>
/// 获取或设置模板 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("template_id")]
[System.Text.Json.Serialization.JsonPropertyName("template_id")]
public string TemplateId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置接收消息的用户 OpenId。
/// </summary>
[Newtonsoft.Json.JsonProperty("touser")]
[System.Text.Json.Serialization.JsonPropertyName("touser")]
public string ToUserOpenId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置小程序页面路径。
/// </summary>
[Newtonsoft.Json.JsonProperty("page")]
[System.Text.Json.Serialization.JsonPropertyName("page")]
public string PagePath { get; set; } = string.Empty;
/// <summary>
/// 获取或设置推送数据 JSON 字符串。
/// </summary>
[Newtonsoft.Json.JsonProperty("data")]
[System.Text.Json.Serialization.JsonPropertyName("data")]
public string? DataJson { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/message/wxopen/employeerelationmsg/send 接口的响应。</para>
/// </summary>
public class CgibinMessageWxopenEmployeeRelationMessageSendResponse : WechatApiResponse
{
}
}

View File

@@ -0,0 +1,17 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/business/unbinduserb2cauthinfo 接口的请求。</para>
/// </summary>
public class WxaBusinessUnbindUserB2CAuthInfoRequest : WechatApiRequest, IInferable<WxaBusinessUnbindUserB2CAuthInfoRequest, WxaBusinessUnbindUserB2CAuthInfoResponse>
{
/// <summary>
/// 获取或设置解绑用户的 OpenId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("openid_list")]
[System.Text.Json.Serialization.JsonPropertyName("openid_list")]
public IList<string> OpenIdList { get; set; } = new List<string>();
}
}

View File

@@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Api.Models
{
/// <summary>
/// <para>表示 [POST] /wxa/business/unbinduserb2cauthinfo 接口的响应。</para>
/// </summary>
public class WxaBusinessUnbindUserB2CAuthInfoResponse : WechatApiResponse
{
}
}

View File

@@ -0,0 +1,6 @@
{
"template_id": "bV8Jk-XXXXXX",
"page": "page/XXX",
"touser": "oL7T268t3zlOb64IvrN64-XXXXXX",
"data": "{\"data\":{\"character_string1\":{\"value\":\"aaa\"},\"amount1\":{\"value\":\"222\"}}}"
}

View File

@@ -0,0 +1,5 @@
{
"openid_list": [
"oL7T268t3zlOb64IvrN64-XXXXXX"
]
}