mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-12-23 14:35:50 +08:00
feat: ✨ 登录日志独立存储 (#161)
请求日志自动分表 [skip ci] Co-authored-by: tk <fiyne1a@dingtalk.com>
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
12
src/backend/NetAdmin.Domain/Dto/Sys/Cache/GetEntriesReq.cs
Normal file
12
src/backend/NetAdmin.Domain/Dto/Sys/Cache/GetEntriesReq.cs
Normal 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; }
|
||||
}
|
||||
34
src/backend/NetAdmin.Domain/Dto/Sys/Cache/GetEntryRsp.cs
Normal file
34
src/backend/NetAdmin.Domain/Dto/Sys/Cache/GetEntryRsp.cs
Normal 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; }
|
||||
}
|
||||
Reference in New Issue
Block a user