feat(work): 新增智慧硬件相关接口

This commit is contained in:
Fu Diwei 2022-10-12 20:41:00 +08:00
parent ed9dd4da75
commit 1b331068ba
34 changed files with 1308 additions and 0 deletions

View File

@ -0,0 +1,27 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Events
{
/// <summary>
/// <para>表示 INFO.device_data_auth_change 事件的数据。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96103 </para>
/// </summary>
public class DeviceDataAuthChangeEvent : WechatWorkEvent, WechatWorkEvent.Serialization.IXmlSerializable
{
/// <summary>
/// 获取或设置第三方应用的 SuiteId。
/// </summary>
[System.Xml.Serialization.XmlElement("SuiteId")]
public string SuiteId { get; set; } = default!;
/// <summary>
/// 获取或设置授权方的 CorpId。
/// </summary>
[System.Xml.Serialization.XmlElement("AuthCorpId")]
public string AuthorizerCorpId { get; set; } = default!;
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[System.Xml.Serialization.XmlElement("AgentID")]
public int AgentId { get; set; }
}
}

View File

@ -0,0 +1,174 @@
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Flurl;
using Flurl.Http;
namespace SKIT.FlurlHttpClient.Wechat.Work
{
public static class WechatWorkClientExecuteCgibinDeviceDataExtensions
{
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/devicedata/get_auth_info 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96097 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinDeviceDataGetAuthInfoResponse> ExecuteCgibinDeviceDataGetAuthInfoAsync(this WechatWorkClient client, Models.CgibinDeviceDataGetAuthInfoRequest 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", "devicedata", "get_auth_info")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinDeviceDataGetAuthInfoResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/devicedata/get_checkin_data 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96027 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinDeviceDataGetCheckinDataResponse> ExecuteCgibinDeviceDataGetCheckinDataAsync(this WechatWorkClient client, Models.CgibinDeviceDataGetCheckinDataRequest 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", "devicedata", "get_checkin_data")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinDeviceDataGetCheckinDataResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/devicedata/get_temperature_data 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96028 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinDeviceDataGetTemperatureDataResponse> ExecuteCgibinDeviceDataGetTemperatureDataAsync(this WechatWorkClient client, Models.CgibinDeviceDataGetTemperatureDataRequest 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", "devicedata", "get_temperature_data")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinDeviceDataGetTemperatureDataResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/devicedata/get_accesscontrol_data 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96029 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinDeviceDataGetAccessControlDataResponse> ExecuteCgibinDeviceDataGetAccessControlDataAsync(this WechatWorkClient client, Models.CgibinDeviceDataGetAccessControlDataRequest 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", "devicedata", "get_accesscontrol_data")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinDeviceDataGetAccessControlDataResponse>(flurlReq, cancellationToken: cancellationToken);
}
#region AccessControlRule
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/devicedata/get_accesscontrol_rule 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96030 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinDeviceDataGetAccessControlRuleResponse> ExecuteCgibinDeviceDataGetAccessControlRuleAsync(this WechatWorkClient client, Models.CgibinDeviceDataGetAccessControlRuleRequest 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", "devicedata", "get_accesscontrol_rule")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinDeviceDataGetAccessControlRuleResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/devicedata/add_accesscontrol_rule 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96031 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinDeviceDataAddAccessControlRuleResponse> ExecuteCgibinDeviceDataAddAccessControlRuleAsync(this WechatWorkClient client, Models.CgibinDeviceDataAddAccessControlRuleRequest 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", "devicedata", "add_accesscontrol_rule")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinDeviceDataAddAccessControlRuleResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/devicedata/mod_accesscontrol_rule 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96221 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinDeviceDataModifyAccessControlRuleResponse> ExecuteCgibinDeviceDataModifyAccessControlRuleAsync(this WechatWorkClient client, Models.CgibinDeviceDataModifyAccessControlRuleRequest 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", "devicedata", "mod_accesscontrol_rule")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinDeviceDataModifyAccessControlRuleResponse>(flurlReq, cancellationToken: cancellationToken);
}
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/devicedata/del_accesscontrol_rule 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/96227 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public static async Task<Models.CgibinDeviceDataDeleteAccessControlRuleResponse> ExecuteCgibinDeviceDataDeleteAccessControlRuleAsync(this WechatWorkClient client, Models.CgibinDeviceDataDeleteAccessControlRuleRequest 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", "devicedata", "del_accesscontrol_rule")
.SetQueryParam("access_token", request.AccessToken);
return await client.SendRequestWithJsonAsync<Models.CgibinDeviceDataDeleteAccessControlRuleResponse>(flurlReq, cancellationToken: cancellationToken);
}
#endregion
}
}

View File

@ -0,0 +1,78 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/add_accesscontrol_rule 接口的请求。</para>
/// </summary>
public class CgibinDeviceDataAddAccessControlRuleRequest : WechatWorkRequest
{
public static class Types
{
public class PassRule
{
public static class Types
{
public class EffectUser
{
/// <summary>
/// 获取或设置成员的 OpenUserId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_userid")]
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
public string OpenUserId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置成员类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_type")]
[System.Text.Json.Serialization.JsonPropertyName("user_type")]
public int? UserType { get; set; }
}
}
/// <summary>
/// 获取或设置门禁放行规则列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("rule_list")]
[System.Text.Json.Serialization.JsonPropertyName("rule_list")]
public IList<string> RuleList { get; set; } = new List<string>();
/// <summary>
/// 获取或设置生效成员列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("effect_open_userid_list")]
[System.Text.Json.Serialization.JsonPropertyName("effect_open_userid_list")]
public IList<Types.EffectUser> EffectUserList { get; set; } = new List<Types.EffectUser>();
}
}
/// <summary>
/// 获取或设置门禁规则名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("rule_name")]
[System.Text.Json.Serialization.JsonPropertyName("rule_name")]
public string RuleName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置设备序列号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_sn_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn_list")]
public IList<string> DeviceSerialNumberList { get; set; } = new List<string>();
/// <summary>
/// 获取或设置门禁规则。
/// </summary>
[Newtonsoft.Json.JsonProperty("pass_rule")]
[System.Text.Json.Serialization.JsonPropertyName("pass_rule")]
public Types.PassRule? PassRule { get; set; }
/// <summary>
/// 获取或设置远程门禁规则。
/// </summary>
[Newtonsoft.Json.JsonProperty("remote_pass_rule")]
[System.Text.Json.Serialization.JsonPropertyName("remote_pass_rule")]
public Types.PassRule? RemotePassRule { get; set; }
}
}

View File

@ -0,0 +1,22 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/add_accesscontrol_rule 接口的响应。</para>
/// </summary>
public class CgibinDeviceDataAddAccessControlRuleResponse : WechatWorkResponse
{
/// <summary>
/// 获取或设置门禁规则 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("rule_id")]
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
public string RuleId { get; set; } = default!;
/// <summary>
/// 获取或设置非法的 OpenUserId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("invalid_list")]
[System.Text.Json.Serialization.JsonPropertyName("invalid_list")]
public string[]? InvalidOpenUserIdList { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/del_accesscontrol_rule 接口的请求。</para>
/// </summary>
public class CgibinDeviceDataDeleteAccessControlRuleRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置门禁规则 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("rule_id")]
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
public string RuleId { get; set; } = string.Empty;
}
}

View File

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

View File

@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_accesscontrol_rule 接口的请求。</para>
/// </summary>
public class CgibinDeviceDataGetAccessControlRuleRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置设备序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_sn")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn")]
public string DeviceSerialNumberList { get; set; } = string.Empty;
}
}

View File

@ -0,0 +1,93 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_accesscontrol_rule 接口的响应。</para>
/// </summary>
public class CgibinDeviceDataGetAccessControlRuleResponse : WechatWorkResponse
{
public static class Types
{
public class PassRuleList
{
/// <summary>
/// 获取或设置门禁规则列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("items")]
[System.Text.Json.Serialization.JsonPropertyName("items")]
public Types.PassRuleItem[] Items { get; set; } = default!;
}
public class PassRuleItem
{
public static class Types
{
public class EffectUser
{
/// <summary>
/// 获取或设置成员的 OpenUserId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_userid")]
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
public string OpenUserId { get; set; } = default!;
/// <summary>
/// 获取或设置成员类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_type")]
[System.Text.Json.Serialization.JsonPropertyName("user_type")]
public int? UserType { get; set; }
}
}
/// <summary>
/// 获取或设置门禁规则 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("rule_id")]
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
public string RuleId { get; set; } = default!;
/// <summary>
/// 获取或设置门禁规则名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("name")]
[System.Text.Json.Serialization.JsonPropertyName("name")]
public string RuleName { get; set; } = default!;
/// <summary>
/// 获取或设置门禁放行规则列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("rule_list")]
[System.Text.Json.Serialization.JsonPropertyName("rule_list")]
public string[] RuleList { get; set; } = default!;
/// <summary>
/// 获取或设置生效成员列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("effect_open_userid_list")]
[System.Text.Json.Serialization.JsonPropertyName("effect_open_userid_list")]
public Types.EffectUser[] EffectUserList { get; set; } = default!;
/// <summary>
/// 获取或设置门禁生效时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("effect_time")]
[System.Text.Json.Serialization.JsonPropertyName("effect_time")]
public long EffectTimestamp { get; set; }
}
}
/// <summary>
/// 获取或设置门禁规则列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("pass_rule")]
[System.Text.Json.Serialization.JsonPropertyName("pass_rule")]
public Types.PassRuleList? PassRuleList { get; set; }
/// <summary>
/// 获取或设置远程门禁规则列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("remote_pass_rule")]
[System.Text.Json.Serialization.JsonPropertyName("remote_pass_rule")]
public Types.PassRuleList? RemotePassRuleList { get; set; }
}
}

View File

@ -0,0 +1,52 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/mod_accesscontrol_rule 接口的请求。</para>
/// </summary>
public class CgibinDeviceDataModifyAccessControlRuleRequest : WechatWorkRequest
{
public static class Types
{
public class PassRule : CgibinDeviceDataAddAccessControlRuleRequest.Types.PassRule
{
}
}
/// <summary>
/// 获取或设置门禁规则 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("rule_id")]
[System.Text.Json.Serialization.JsonPropertyName("rule_id")]
public string RuleId { get; set; } = string.Empty;
/// <summary>
/// 获取或设置门禁规则名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("rule_name")]
[System.Text.Json.Serialization.JsonPropertyName("rule_name")]
public string RuleName { get; set; } = string.Empty;
/// <summary>
/// 获取或设置设备序列号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_sn_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn_list")]
public IList<string> DeviceSerialNumberList { get; set; } = new List<string>();
/// <summary>
/// 获取或设置门禁规则。
/// </summary>
[Newtonsoft.Json.JsonProperty("pass_rule")]
[System.Text.Json.Serialization.JsonPropertyName("pass_rule")]
public Types.PassRule? PassRule { get; set; }
/// <summary>
/// 获取或设置远程门禁规则。
/// </summary>
[Newtonsoft.Json.JsonProperty("remote_pass_rule")]
[System.Text.Json.Serialization.JsonPropertyName("remote_pass_rule")]
public Types.PassRule? RemotePassRule { get; set; }
}
}

View File

@ -0,0 +1,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/mod_accesscontrol_rule 接口的响应。</para>
/// </summary>
public class CgibinDeviceDataModifyAccessControlRuleResponse : WechatWorkResponse
{
/// <summary>
/// 获取或设置非法的 OpenUserId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("invalid_list")]
[System.Text.Json.Serialization.JsonPropertyName("invalid_list")]
public string[]? InvalidOpenUserIdList { get; set; }
}
}

View File

@ -0,0 +1,73 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_accesscontrol_data 接口的请求。</para>
/// </summary>
public class CgibinDeviceDataGetAccessControlDataRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("agentid")]
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
public int? AgentId { get; set; }
/// <summary>
/// 获取或设置成员类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_type")]
[System.Text.Json.Serialization.JsonPropertyName("user_type")]
public int UserType { get; set; }
/// <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("data_filter_type")]
[System.Text.Json.Serialization.JsonPropertyName("data_filter_type")]
public int DataFilterType { get; set; }
/// <summary>
/// 获取或设置设备序列号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_sn_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn_list")]
public IList<string>? DeviceSerialNumberList { get; set; }
/// <summary>
/// 获取或设置成员的 OpenUserId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_userid_list")]
[System.Text.Json.Serialization.JsonPropertyName("open_userid_list")]
public IList<string>? OpenUserIdList { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int? Limit { get; set; }
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("cursor")]
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
public string? Cursor { get; set; }
}
}

View File

@ -0,0 +1,80 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_accesscontrol_data 接口的响应。</para>
/// </summary>
public class CgibinDeviceDataGetAccessControlDataResponse : WechatWorkResponse
{
public static class Types
{
public class AccessControlDataList
{
/// <summary>
/// 获取或设置门禁通行数据列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("items")]
[System.Text.Json.Serialization.JsonPropertyName("items")]
public AccessControlDataItem[] Items { get; set; } = default!;
}
public class AccessControlDataItem
{
/// <summary>
/// 获取或设置成员类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_type")]
[System.Text.Json.Serialization.JsonPropertyName("user_type")]
public int UserType { get; set; }
/// <summary>
/// 获取或设置成员的 OpenUserId。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_userid")]
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
public string OpenUserId { get; set; } = default!;
/// <summary>
/// 获取或设置设备的序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_sn")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn")]
public string DeviceSerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置通行时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("timestamp")]
[System.Text.Json.Serialization.JsonPropertyName("timestamp")]
public long Timestamp { get; set; }
/// <summary>
/// 获取或设置通行类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("pass_type")]
[System.Text.Json.Serialization.JsonPropertyName("pass_type")]
public int PassType { get; set; }
/// <summary>
/// 获取或设置通行方法。
/// </summary>
[Newtonsoft.Json.JsonProperty("pass_method")]
[System.Text.Json.Serialization.JsonPropertyName("pass_method")]
public int PassMethod { get; set; }
}
}
/// <summary>
/// 获取或设置门禁通行数据列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("accesscontrol_data")]
[System.Text.Json.Serialization.JsonPropertyName("accesscontrol_data")]
public Types.AccessControlDataList AccessControlDataList { 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,15 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_auth_info 接口的请求。</para>
/// </summary>
public class CgibinDeviceDataGetAuthInfoRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("agentid")]
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
public int? AgentId { get; set; }
}
}

View File

@ -0,0 +1,66 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_auth_info 接口的响应。</para>
/// </summary>
public class CgibinDeviceDataGetAuthInfoResponse : WechatWorkResponse
{
public static class Types
{
public class DeviceList
{
/// <summary>
/// 获取或设置设备列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("item")]
[System.Text.Json.Serialization.JsonPropertyName("item")]
public DeviceItem[] Items { get; set; } = default!;
}
public class DeviceItem
{
/// <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_sn")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn")]
public string DeviceSerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置设备出厂型号。
/// </summary>
[Newtonsoft.Json.JsonProperty("model_name")]
[System.Text.Json.Serialization.JsonPropertyName("model_name")]
public string? ModelName { get; set; }
/// <summary>
/// 获取或设置设备出厂名。
/// </summary>
[Newtonsoft.Json.JsonProperty("default_name")]
[System.Text.Json.Serialization.JsonPropertyName("default_name")]
public string? DefaultName { get; set; }
/// <summary>
/// 获取或设置设备备注名。
/// </summary>
[Newtonsoft.Json.JsonProperty("remark_name")]
[System.Text.Json.Serialization.JsonPropertyName("remark_name")]
public string? RemarkName { get; set; }
}
}
/// <summary>
/// 获取或设置设备列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_list")]
public Types.DeviceList DeviceList { get; set; } = default!;
}
}

View File

@ -0,0 +1,73 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_checkin_data 接口的请求。</para>
/// </summary>
public class CgibinDeviceDataGetCheckinDataRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("agentid")]
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
public int? AgentId { get; set; }
/// <summary>
/// 获取或设置成员类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_type")]
[System.Text.Json.Serialization.JsonPropertyName("user_type")]
public int UserType { get; set; }
/// <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("data_filter_type")]
[System.Text.Json.Serialization.JsonPropertyName("data_filter_type")]
public int DataFilterType { get; set; }
/// <summary>
/// 获取或设置设备序列号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_sn_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn_list")]
public IList<string>? DeviceSerialNumberList { get; set; }
/// <summary>
/// 获取或设置成员的 OpenUserId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_userid_list")]
[System.Text.Json.Serialization.JsonPropertyName("open_userid_list")]
public IList<string>? OpenUserIdList { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int? Limit { get; set; }
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("cursor")]
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
public string? Cursor { get; set; }
}
}

View File

@ -0,0 +1,59 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_checkin_data 接口的响应。</para>
/// </summary>
public class CgibinDeviceDataGetCheckinDataResponse : WechatWorkResponse
{
public static class Types
{
public class CheckinDataList
{
/// <summary>
/// 获取或设置打卡数据列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("items")]
[System.Text.Json.Serialization.JsonPropertyName("items")]
public CheckinDataItem[] Items { get; set; } = default!;
}
public class CheckinDataItem
{
/// <summary>
/// 获取或设置成员的 OpenUserId。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_userid")]
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
public string OpenUserId { get; set; } = default!;
/// <summary>
/// 获取或设置设备的序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_sn")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn")]
public string DeviceSerialNumber { 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("checkindata")]
[System.Text.Json.Serialization.JsonPropertyName("checkindata")]
public Types.CheckinDataList CheckinDataList { 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,73 @@
using System.Collections.Generic;
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_temperature_data 接口的请求。</para>
/// </summary>
public class CgibinDeviceDataGetTemperatureDataRequest : WechatWorkRequest
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("agentid")]
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
public int? AgentId { get; set; }
/// <summary>
/// 获取或设置成员类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_type")]
[System.Text.Json.Serialization.JsonPropertyName("user_type")]
public int UserType { get; set; }
/// <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("data_filter_type")]
[System.Text.Json.Serialization.JsonPropertyName("data_filter_type")]
public int DataFilterType { get; set; }
/// <summary>
/// 获取或设置设备序列号列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_sn_list")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn_list")]
public IList<string>? DeviceSerialNumberList { get; set; }
/// <summary>
/// 获取或设置成员的 OpenUserId 列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_userid_list")]
[System.Text.Json.Serialization.JsonPropertyName("open_userid_list")]
public IList<string>? OpenUserIdList { get; set; }
/// <summary>
/// 获取或设置分页每页数量。
/// </summary>
[Newtonsoft.Json.JsonProperty("limit")]
[System.Text.Json.Serialization.JsonPropertyName("limit")]
public int? Limit { get; set; }
/// <summary>
/// 获取或设置翻页标记。
/// </summary>
[Newtonsoft.Json.JsonProperty("cursor")]
[System.Text.Json.Serialization.JsonPropertyName("cursor")]
public string? Cursor { get; set; }
}
}

View File

@ -0,0 +1,80 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/devicedata/get_temperature_data 接口的响应。</para>
/// </summary>
public class CgibinDeviceDataGetTemperatureDataResponse : WechatWorkResponse
{
public static class Types
{
public class TemperatureDataList
{
/// <summary>
/// 获取或设置温度检测数据列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("items")]
[System.Text.Json.Serialization.JsonPropertyName("items")]
public TemperatureDataItem[] Items { get; set; } = default!;
}
public class TemperatureDataItem
{
/// <summary>
/// 获取或设置成员类型。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_type")]
[System.Text.Json.Serialization.JsonPropertyName("user_type")]
public int UserType { get; set; }
/// <summary>
/// 获取或设置成员的 OpenUserId。
/// </summary>
[Newtonsoft.Json.JsonProperty("open_userid")]
[System.Text.Json.Serialization.JsonPropertyName("open_userid")]
public string OpenUserId { get; set; } = default!;
/// <summary>
/// 获取或设置设备的序列号。
/// </summary>
[Newtonsoft.Json.JsonProperty("device_sn")]
[System.Text.Json.Serialization.JsonPropertyName("device_sn")]
public string DeviceSerialNumber { get; set; } = default!;
/// <summary>
/// 获取或设置测温时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("timestamp")]
[System.Text.Json.Serialization.JsonPropertyName("timestamp")]
public long Timestamp { get; set; }
/// <summary>
/// 获取或设置测温温度。
/// </summary>
[Newtonsoft.Json.JsonProperty("temperature")]
[System.Text.Json.Serialization.JsonPropertyName("temperature")]
public string Temperature { 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("temperature_data")]
[System.Text.Json.Serialization.JsonPropertyName("temperature_data")]
public Types.TemperatureDataList TemperatureDataList { 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,7 @@
<xml>
<SuiteId><![CDATA[ww4asffe99e54cxxxx]]></SuiteId>
<AuthCorpId><![CDATA[wxf8b4f85f3a79xxxx]]></AuthCorpId>
<InfoType><![CDATA[device_data_auth_change]]></InfoType>
<TimeStamp>1403610513</TimeStamp>
<AgentID>1000001</AgentID>
</xml>

View File

@ -0,0 +1,36 @@
{
"device_sn_list": ["SN"],
"rule_name": "access_rule_name_xxx",
"pass_rule": {
"rule_list": [
"9:00-10:00 * * 1-5 *",
"9:00-10:00,15:30-17:45 * * 0,6 *"
],
"effect_open_userid_list": [
{
"open_userid": "user1",
"user_type": 0
},
{
"open_userid": "user2",
"user_type": 2
}
]
},
"remote_pass_rule": {
"rule_list": [
"9:00-10:00 * * 1-5 *",
"9:00-10:00,15:30-17:45 * * 0,6 *"
],
"effect_open_userid_list": [
{
"open_userid": "user1",
"user_type": 0
},
{
"open_userid": "user2",
"user_type": 2
}
]
}
}

View File

@ -0,0 +1,6 @@
{
"errcode": 0,
"errmsg": "ok",
"rule_id": "xxx",
"invalid_list": []
}

View File

@ -0,0 +1,78 @@
{
"errcode": 0,
"errmsg": "ok",
"pass_rule": {
"items": [
{
"rule_id": "xxx",
"name": "rule_name",
"rule_list": [
"9:00-10:00 * * 1-5 *",
"16:00-19:05 * * 6 *",
"20:00-21:30 * * 0 *"
],
"effect_time": 1542874137,
"effect_open_userid_list": [
{
"open_userid": "user1",
"user_type": 0
},
{
"open_userid": "user2",
"user_type": 2
}
]
},
{
"rule_id": "xxq",
"rule_list": ["9:300-10:00 * * 6 *"],
"effect_time": 1542874137,
"effect_open_userid_list": [
{
"open_userid": "user1",
"user_type": 0
},
{
"open_userid": "user2",
"user_type": 2
}
]
}
]
},
"remote_pass_rule": {
"items": [
{
"rule_id": "xxx",
"name": "rule_name",
"rule_list": ["9:00-10:00 * * 1-5 *", "11:00-12:00 * * 6,0 *"],
"effect_time": 1542874137,
"effect_open_userid_list": [
{
"open_userid": "user1",
"user_type": 0
},
{
"open_userid": "user2",
"user_type": 2
}
]
},
{
"rule_id": "xxq",
"rule_list": ["9:300-10:00 * * 6 *"],
"effect_time": 1542874137,
"effect_open_userid_list": [
{
"open_userid": "user1",
"user_type": 0
},
{
"open_userid": "user2",
"user_type": 2
}
]
}
]
}
}

View File

@ -0,0 +1,37 @@
{
"rule_id": "xxx",
"device_sn_list": ["SN"],
"rule_name": "access_rule_name_xxx",
"pass_rule": {
"rule_list": [
"9:00-10:00 * * 1-5 *",
"9:00-10:00,15:30-17:45 * * 0,6 *"
],
"effect_open_userid_list": [
{
"open_userid": "user1",
"user_type": 0
},
{
"open_userid": "user2",
"user_type": 2
}
]
},
"remote_pass_rule": {
"rule_list": [
"9:00-10:00 * * 1-5 *",
"9:00-10:00,15:30-17:45 * * 0,6 *"
],
"effect_open_userid_list": [
{
"open_userid": "user1",
"user_type": 0
},
{
"open_userid": "user2",
"user_type": 2
}
]
}
}

View File

@ -0,0 +1,11 @@
{
"user_type": 0,
"begin_time": 12345,
"end_time": 67890,
"data_filter_type": 1,
"device_sn_list": ["SN1", "SN2"],
"open_userid_list": [],
"cursor": "CURSOR",
"limit": 0,
"agentid": 10000
}

View File

@ -0,0 +1,25 @@
{
"errcode": 0,
"errmsg": "ok",
"accesscontrol_data": {
"items": [
{
"open_userid": "userid1",
"user_type": 0,
"timestamp": 1662697304,
"pass_type": 1,
"pass_method": 0,
"device_sn": "C00123122"
},
{
"open_userid": "userid2",
"user_type": 0,
"timestamp": 1662697304,
"pass_type": 1,
"pass_method": 0,
"device_sn": "C00123122"
}
]
},
"next_cursor": "FVXbiWcnRUTZ8ZBzI905eQ=="
}

View File

@ -0,0 +1,15 @@
{
"errcode": 0,
"errmsg": "ok",
"device_list": {
"item": [
{
"device_sn": "SN",
"remark_name": "设备备注名",
"default_name": "设备出厂名",
"model_name": "PRODUCT_MODEL",
"device_type": 1
}
]
}
}

View File

@ -0,0 +1,10 @@
{
"user_type": 0,
"begin_time": 12345,
"end_time": 67890,
"data_filter_type": 1,
"device_sn_list": ["SN1", "SN2"],
"cursor": "CURSOR",
"limit": 0,
"agentid": 10000
}

View File

@ -0,0 +1,14 @@
{
"errcode": 0,
"errmsg": "ok",
"checkindata": {
"items": [
{
"open_userid": "x1",
"checkin_time": 12345,
"device_sn": "SN"
}
]
},
"next_cursor": "NEXT_CURSOR"
}

View File

@ -0,0 +1,11 @@
{
"user_type": 0,
"begin_time": 12345,
"end_time": 67890,
"data_filter_type": 1,
"device_sn_list": ["SN1", "SN2"],
"open_userid_list": [],
"cursor": "CURSOR",
"limit": 0,
"agentid": 10000
}

View File

@ -0,0 +1,25 @@
{
"errcode": 0,
"errmsg": "ok",
"temperature_data": {
"items": [
{
"open_userid": "userid1",
"user_type": 0,
"timestamp": 1662697304,
"temperature": "36.7",
"status": 0,
"device_sn": "C00123122"
},
{
"open_userid": "userid2",
"user_type": 0,
"timestamp": 1662697304,
"temperature": "36.7",
"status": 0,
"device_sn": "C00123122"
}
]
},
"next_cursor": "FVXbiWcnRUTZ8ZBzI905eQ=="
}