mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(work): 新增为打卡人员补卡相关接口
This commit is contained in:
parent
eb61f86301
commit
fabc25935f
@ -174,5 +174,25 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinCheckinAddCheckinUserFaceResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/checkin/punch_correction 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/95803 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinCheckinPunchCorrectionResponse> ExecuteCgibinCheckinPunchCorrectionAsync(this WechatWorkClient client, Models.CgibinCheckinPunchCorrectionRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (client is null) throw new ArgumentNullException(nameof(client));
|
||||
if (request is null) throw new ArgumentNullException(nameof(request));
|
||||
|
||||
IFlurlRequest flurlReq = client
|
||||
.CreateRequest(request, HttpMethod.Post, "cgi-bin", "checkin", "punch_correction")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinCheckinPunchCorrectionResponse>(flurlReq, data: request, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/checkin/punch_correction 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinCheckinPunchCorrectionRequest : WechatWorkRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置成员账号。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应打卡日期时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("schedule_date_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("schedule_date_time")]
|
||||
public long ScheduleDateTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置应打卡时间点偏移秒数。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("schedule_checkin_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("schedule_checkin_time")]
|
||||
public int? ScheduleCheckinTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置实际打卡时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("checkin_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("checkin_time")]
|
||||
public long CheckinTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置备注信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("remark")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/checkin/punch_correction 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinCheckinPunchCorrectionResponse : WechatWorkResponse
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"userid": "zhangsan",
|
||||
"schedule_date_time": 1654444800,
|
||||
"schedule_checkin_time": 32400,
|
||||
"checkin_time": 1654486827,
|
||||
"remark": "备注信息"
|
||||
}
|
Loading…
Reference in New Issue
Block a user