feat(work): 随官方更新获取企业永久授权码接口模型

This commit is contained in:
fudiwei 2022-12-04 00:59:07 +08:00
parent c8266df89e
commit 4a4853f778
3 changed files with 99 additions and 7 deletions

View File

@ -101,7 +101,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/service/get_permanent_code 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90603 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90788 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91911 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>
@ -121,8 +121,7 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
/// <summary>
/// <para>异步调用 [POST] /cgi-bin/service/get_auth_info 接口。</para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90604 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/90789 </para>
/// <para>REF: https://developer.work.weixin.qq.com/document/path/91912 </para>
/// </summary>
/// <param name="client"></param>
/// <param name="request"></param>

View File

@ -1,4 +1,4 @@
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
{
/// <summary>
/// <para>表示 [POST] /cgi-bin/service/get_permanent_code 接口的响应。</para>
@ -56,14 +56,14 @@
public string? OpenUserId { get; set; }
}
public class Register
public class RegisterCode
{
/// <summary>
/// 获取或设置注册码。
/// </summary>
[Newtonsoft.Json.JsonProperty("register_code")]
[System.Text.Json.Serialization.JsonPropertyName("register_code")]
public string RegisterCode { get; set; } = default!;
public string Code { get; set; } = default!;
/// <summary>
/// 获取或设置推广包 ID。
@ -79,6 +79,78 @@
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string? State { get; set; }
}
public class Edition
{
public static class Types
{
public class Agent
{
/// <summary>
/// 获取或设置应用 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("agentid")]
[System.Text.Json.Serialization.JsonPropertyName("agentid")]
public int AgentId { get; set; }
/// <summary>
/// 获取或设置版本 ID。
/// </summary>
[Newtonsoft.Json.JsonProperty("edition_id")]
[System.Text.Json.Serialization.JsonPropertyName("edition_id")]
public string EditionId { get; set; } = default!;
/// <summary>
/// 获取或设置版本名称。
/// </summary>
[Newtonsoft.Json.JsonProperty("edition_name")]
[System.Text.Json.Serialization.JsonPropertyName("edition_name")]
public string EditionName { get; set; } = default!;
/// <summary>
/// 获取或设置应用状态。
/// </summary>
[Newtonsoft.Json.JsonProperty("app_status")]
[System.Text.Json.Serialization.JsonPropertyName("app_status")]
public int AppStatus { get; set; }
/// <summary>
/// 获取或设置用户上限。
/// </summary>
[Newtonsoft.Json.JsonProperty("user_limit")]
[System.Text.Json.Serialization.JsonPropertyName("user_limit")]
public int UserLimit { get; set; }
/// <summary>
/// 获取或设置过期时间戳。
/// </summary>
[Newtonsoft.Json.JsonProperty("expired_time")]
[System.Text.Json.Serialization.JsonPropertyName("expired_time")]
public long ExpireTimestamp { get; set; }
/// <summary>
/// 获取或设置是否是虚拟版本。
/// </summary>
[Newtonsoft.Json.JsonProperty("is_virtual_version")]
[System.Text.Json.Serialization.JsonPropertyName("is_virtual_version")]
public bool IsVirtualVersion { get; set; }
/// <summary>
/// 获取或设置是否由企业互联或上下游分享安装。
/// </summary>
[Newtonsoft.Json.JsonProperty("is_shared_from_other_corp")]
[System.Text.Json.Serialization.JsonPropertyName("is_shared_from_other_corp")]
public bool IsSharedFromOtherCorp { get; set; }
}
}
/// <summary>
/// 获取或设置授权的应用信息列表。
/// </summary>
[Newtonsoft.Json.JsonProperty("agent")]
[System.Text.Json.Serialization.JsonPropertyName("agent")]
public Types.Agent[] AgentList { get; set; } = default!;
}
}
/// <summary>
@ -135,7 +207,7 @@
/// </summary>
[Newtonsoft.Json.JsonProperty("register_code_info")]
[System.Text.Json.Serialization.JsonPropertyName("register_code_info")]
public Types.Register? Register { get; set; }
public Types.RegisterCode? RegisterCode { get; set; }
/// <summary>
/// 获取或设置扫码或者授权链接中的自定义参数。
@ -143,5 +215,12 @@
[Newtonsoft.Json.JsonProperty("state")]
[System.Text.Json.Serialization.JsonPropertyName("state")]
public string? State { get; set; }
/// <summary>
/// 获取或设置当前生效的版本信息。
/// </summary>
[Newtonsoft.Json.JsonProperty("edition_info")]
[System.Text.Json.Serialization.JsonPropertyName("edition_info")]
public Types.Edition? Edition { get; set; }
}
}

View File

@ -69,5 +69,19 @@
"register_code": "1111",
"template_id": "tpl111",
"state": "state001"
},
"edition_info": {
"agent": [
{
"agentid": 1,
"edition_id": "RLS65535",
"edition_name": "协同版",
"app_status": 3,
"user_limit": 200,
"expired_time": 1541990791,
"is_virtual_version": false,
"is_shared_from_other_corp": true
}
]
}
}