feat(work): 新增为打卡人员补卡相关接口

This commit is contained in:
Fu Diwei 2022-08-15 19:58:39 +08:00
parent eb61f86301
commit fabc25935f
4 changed files with 79 additions and 0 deletions

View File

@ -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);
}
}
}

View File

@ -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; }
}
}

View File

@ -0,0 +1,9 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/checkin/punch_correction 接口的响应。</para>
/// </summary>
public class CgibinCheckinPunchCorrectionResponse : WechatWorkResponse
{
}
}

View File

@ -0,0 +1,7 @@
{
"userid": "zhangsan",
"schedule_date_time": 1654444800,
"schedule_checkin_time": 32400,
"checkin_time": 1654486827,
"remark": "备注信息"
}