mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-11 02:07:49 +08:00
feat(work): 新增添加打卡记录接口
This commit is contained in:
@@ -129,6 +129,29 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
|||||||
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinCheckinSetCheckinScheduleListResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinCheckinSetCheckinScheduleListResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <para>异步调用 [POST] /cgi-bin/checkin/add_checkin_record 接口。</para>
|
||||||
|
/// <para>
|
||||||
|
/// REF: <br/>
|
||||||
|
/// <![CDATA[ https://developer.work.weixin.qq.com/document/path/99647 ]]>
|
||||||
|
/// </para>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <param name="cancellationToken"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static async Task<Models.CgibinCheckinAddCheckinRecordResponse> ExecuteCgibinCheckinAddCheckinRecordAsync(this WechatWorkClient client, Models.CgibinCheckinAddCheckinRecordRequest 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", "checkin", "add_checkin_record")
|
||||||
|
.SetQueryParam("access_token", request.AccessToken);
|
||||||
|
|
||||||
|
return await client.SendFlurlRequestAsJsonAsync<Models.CgibinCheckinAddCheckinRecordResponse>(flurlReq, data: request, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>异步调用 [POST] /cgi-bin/checkin/addcheckinuserface 接口。</para>
|
/// <para>异步调用 [POST] /cgi-bin/checkin/addcheckinuserface 接口。</para>
|
||||||
/// <para>
|
/// <para>
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/checkin/add_checkin_record 接口的请求。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinCheckinAddCheckinRecordRequest : WechatWorkRequest
|
||||||
|
{
|
||||||
|
public static class Types
|
||||||
|
{
|
||||||
|
public class Record
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置成员账号。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("userid")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||||
|
public string UserId { get; set; } = default!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡时间戳。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("checkin_time")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("checkin_time")]
|
||||||
|
public long CheckinTimestamp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡地点名称。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("location_title")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("location_title")]
|
||||||
|
public string? LocationTitle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡地点详情。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("location_detail")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("location_detail")]
|
||||||
|
public string? LocationDetail { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡地点经度。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("lng")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("lng")]
|
||||||
|
public decimal? LocationLongitude { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡地点纬度。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("lat")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("lat")]
|
||||||
|
public decimal? LocationLatitude { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡 Wi-Fi 名称。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("wifiname")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("wifiname")]
|
||||||
|
public string? WiFiName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡 Wi-Fi 的 MAC 地址或 BSSID。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("wifimac")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("wifimac")]
|
||||||
|
public string? WiFiMac { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡设备类型。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("device_type")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("device_type")]
|
||||||
|
public int? DeviceType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡设备品牌。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("device_detail")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("device_detail")]
|
||||||
|
public string? DeviceDetail { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置备注。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("notes")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("notes")]
|
||||||
|
public string? Notes { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置附件图片 MediaId 列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("mediaids")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("mediaids")]
|
||||||
|
public IList<string>? MediaIdList { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取或设置打卡记录列表。
|
||||||
|
/// </summary>
|
||||||
|
[Newtonsoft.Json.JsonProperty("records")]
|
||||||
|
[System.Text.Json.Serialization.JsonPropertyName("records")]
|
||||||
|
public IList<Types.Record> RecordList { get; set; } = new List<Types.Record>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <para>表示 [POST] /cgi-bin/checkin/add_checkin_record 接口的响应。</para>
|
||||||
|
/// </summary>
|
||||||
|
public class CgibinCheckinAddCheckinRecordResponse : WechatWorkResponse
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
|||||||
{
|
{
|
||||||
public static class Types
|
public static class Types
|
||||||
{
|
{
|
||||||
public class Data
|
public class Record
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置成员账号。
|
/// 获取或设置成员账号。
|
||||||
@@ -129,11 +129,11 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
|||||||
public string? Notes { get; set; }
|
public string? Notes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取或设置备注附件图片 MediaId 列表。
|
/// 获取或设置附件图片 MediaId 列表。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("mediaids")]
|
[Newtonsoft.Json.JsonProperty("mediaids")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("mediaids")]
|
[System.Text.Json.Serialization.JsonPropertyName("mediaids")]
|
||||||
public string[]? NotesMediaIdList { get; set; }
|
public string[]? MediaIdList { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,6 +142,6 @@ namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Newtonsoft.Json.JsonProperty("checkindata")]
|
[Newtonsoft.Json.JsonProperty("checkindata")]
|
||||||
[System.Text.Json.Serialization.JsonPropertyName("checkindata")]
|
[System.Text.Json.Serialization.JsonPropertyName("checkindata")]
|
||||||
public Types.Data[] DataList { get; set; } = default!;
|
public Types.Record[] RecordList { get; set; } = default!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"records": [
|
||||||
|
{
|
||||||
|
"userid": "userId",
|
||||||
|
"checkin_time": 1705899000,
|
||||||
|
"location_title": "1234",
|
||||||
|
"location_detail": "1234",
|
||||||
|
"mediaids": [
|
||||||
|
"mediaId"
|
||||||
|
],
|
||||||
|
"notes": "",
|
||||||
|
"device_type": 1,
|
||||||
|
"lat": 22234233,
|
||||||
|
"lng": 1233123,
|
||||||
|
"device_detail": "device_detail_test",
|
||||||
|
"wifiname": "Tencent-WiFi",
|
||||||
|
"wifimac": "a2:8b:7f:c0:27:4b"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user