feat: 登录日志独立存储 (#161)

请求日志自动分表
[skip ci]

Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
2024-07-26 17:46:56 +08:00
committed by GitHub
parent e1bea2ec31
commit faaf5aa0fc
74 changed files with 1501 additions and 470 deletions

View File

@@ -6,7 +6,7 @@ namespace NetAdmin.Domain.Dto.Sys.Cache;
public sealed record GetAllEntriesReq : DataAbstraction
{
/// <summary>
/// 数据库索引号
/// 关键词
/// </summary>
public int DbIndex { get; init; }
public string Keywords { get; init; }
}

View File

@@ -1,55 +0,0 @@
namespace NetAdmin.Domain.Dto.Sys.Cache;
/// <summary>
/// 响应:获取所有缓存项
/// </summary>
public sealed record GetAllEntriesRsp : DataAbstraction
{
/// <summary>
/// Initializes a new instance of the <see cref="GetAllEntriesRsp" /> class.
/// </summary>
public GetAllEntriesRsp() { }
/// <summary>
/// Initializes a new instance of the <see cref="GetAllEntriesRsp" /> class.
/// </summary>
public GetAllEntriesRsp(long absExp, string key, long sldExp, string data)
{
AbsExp = absExp;
Key = key;
SldExp = sldExp;
Data = data;
}
/// <summary>
/// 绝对过期时间
/// </summary>
public DateTime? AbsExpTime => AbsExp == -1 ? null : DateTime.FromBinary(AbsExp).ToLocalTime();
/// <summary>
/// 滑动过期时间
/// </summary>
public DateTime? SldExpTime => SldExp == -1 ? null : DateTime.FromBinary(SldExp).ToLocalTime();
/// <summary>
/// 绝对过期时间
/// </summary>
[JsonInclude]
public long AbsExp { get; init; }
/// <summary>
/// 缓存值
/// </summary>
public string Data { get; init; }
/// <summary>
/// 缓存键
/// </summary>
public string Key { get; init; }
/// <summary>
/// 滑动过期时间
/// </summary>
[JsonInclude]
public long SldExp { get; init; }
}

View File

@@ -0,0 +1,12 @@
namespace NetAdmin.Domain.Dto.Sys.Cache;
/// <summary>
/// 请求:获取缓存项
/// </summary>
public sealed record GetEntriesReq : DataAbstraction
{
/// <summary>
/// 缓存键
/// </summary>
public string Key { get; init; }
}

View File

@@ -0,0 +1,34 @@
using StackExchange.Redis;
namespace NetAdmin.Domain.Dto.Sys.Cache;
/// <summary>
/// 响应:获取所有缓存项
/// </summary>
public sealed record GetEntryRsp : DataAbstraction
{
/// <summary>
/// Initializes a new instance of the <see cref="GetEntryRsp" /> class.
/// </summary>
public GetEntryRsp() { }
/// <summary>
/// 缓存值
/// </summary>
public string Data { get; set; }
/// <summary>
/// 过期时间
/// </summary>
public DateTime? ExpireTime { get; init; }
/// <summary>
/// 缓存键
/// </summary>
public string Key { get; init; }
/// <summary>
/// 数据类型
/// </summary>
public RedisType Type { get; init; }
}