mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-15 23:13:32 +08:00
feat(work): 新增查询文件保密模式操作记录接口
This commit is contained in:
parent
1b8734fc5e
commit
8b461a5b92
@ -0,0 +1,32 @@
|
||||
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 WechatWorkClientExecuteCgibinSecurityExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>异步调用 [POST] /cgi-bin/security/get_file_oper_record 接口。</para>
|
||||
/// <para>REF: https://developer.work.weixin.qq.com/document/path/98079 </para>
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<Models.CgibinSecurityGetFileOperateRecordResponse> ExecuteCgibinSecurityGetFileOperateRecordAsync(this WechatWorkClient client, Models.CgibinSecurityGetFileOperateRecordRequest 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", "security", "get_file_oper_record")
|
||||
.SetQueryParam("access_token", request.AccessToken);
|
||||
|
||||
return await client.SendRequestWithJsonAsync<Models.CgibinSecurityGetFileOperateRecordResponse>(flurlReq, cancellationToken: cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/security/get_file_oper_record 接口的请求。</para>
|
||||
/// </summary>
|
||||
public class CgibinSecurityGetFileOperateRecordRequest : WechatWorkRequest
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Operation
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置操作类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("source")]
|
||||
public int? Source { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置开始时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("start_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("start_time")]
|
||||
public long StartTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置结束时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("end_time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("end_time")]
|
||||
public long EndTimestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作者 UserId 列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid_list")]
|
||||
public IList<string>? UserIdList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("operation")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("operation")]
|
||||
public Types.Operation? Operation { 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; }
|
||||
}
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
namespace SKIT.FlurlHttpClient.Wechat.Work.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>表示 [POST] /cgi-bin/security/get_file_oper_record 接口的响应。</para>
|
||||
/// </summary>
|
||||
public class CgibinSecurityGetFileOperateRecordResponse : WechatWorkResponse
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Record
|
||||
{
|
||||
public static class Types
|
||||
{
|
||||
public class Operation
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置操作类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作来源。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("source")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("source")]
|
||||
public int? Source { get; set; }
|
||||
}
|
||||
|
||||
public class ExternalUser
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取或设置用户类型。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("type")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("type")]
|
||||
public int Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用户名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("name")]
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业微信用户名。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("corp_name")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("corp_name")]
|
||||
public string? CorpName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业用户 UserId。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("userid")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("userid")]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置企业外部人员帐号信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("external_user")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("external_user")]
|
||||
public Types.ExternalUser? ExternalUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作信息。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("operation")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("operation")]
|
||||
public Types.Operation Operation { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置时间戳。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("time")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("time")]
|
||||
public long Timestamp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置文件操作说明。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("file_info")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("file_info")]
|
||||
public string? FileInfo { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置操作记录列表。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("record_list")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("record_list")]
|
||||
public Types.Record[] RecordList { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置是否还有更多数据。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("has_more")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("has_more")]
|
||||
public bool HasMore { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置翻页标记。
|
||||
/// </summary>
|
||||
[Newtonsoft.Json.JsonProperty("next_cursor")]
|
||||
[System.Text.Json.Serialization.JsonPropertyName("next_cursor")]
|
||||
public string? NextCursor { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"start_time": 166666666,
|
||||
"end_time": 166666667,
|
||||
"userid_list": [ "zhangsan", "lisi" ],
|
||||
"operation": {
|
||||
"type": 1,
|
||||
"source": 401
|
||||
},
|
||||
"cursor": "ngLgjieajgieo",
|
||||
"limit": 100
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
{
|
||||
"errcode": 0,
|
||||
"errmsg": "ok",
|
||||
"has_more": true,
|
||||
"next_cursor": "gejMjgLjgeigoejg",
|
||||
"record_list": [
|
||||
{
|
||||
"time": 16666666666,
|
||||
"userid": "zhangsan",
|
||||
"operation": {
|
||||
"type": 101,
|
||||
"source": 401
|
||||
},
|
||||
"file_info": "1234567890.jpg"
|
||||
},
|
||||
{
|
||||
"time": 16666666666,
|
||||
"external_user": {
|
||||
"type": 2,
|
||||
"name": "xxx",
|
||||
"corp_name": "十分科技"
|
||||
},
|
||||
"operation": {
|
||||
"type": 113
|
||||
},
|
||||
"file_info": "通过zhangsan的链接下载了1234567890.jpg"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user