mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-07-06 18:48:15 +08:00
wip: 🧠 初步的框架
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.RequestLog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:创建请求日志
|
||||
/// </summary>
|
||||
public sealed record CreateRequestLogReq : Sys_RequestLog;
|
@ -0,0 +1,8 @@
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.RequestLog;
|
||||
|
||||
/// <summary>
|
||||
/// 请求:查询请求日志
|
||||
/// </summary>
|
||||
public sealed record QueryRequestLogReq : Sys_RequestLog;
|
@ -0,0 +1,106 @@
|
||||
using NetAdmin.Domain.DbMaps.Dependency.Fields;
|
||||
using NetAdmin.Domain.DbMaps.Sys;
|
||||
|
||||
namespace NetAdmin.Domain.Dto.Sys.RequestLog;
|
||||
|
||||
/// <summary>
|
||||
/// 响应:查询请求日志
|
||||
/// </summary>
|
||||
public sealed record QueryRequestLogRsp : Sys_RequestLog, IRegister
|
||||
{
|
||||
/// <summary>
|
||||
/// 操作系统
|
||||
/// </summary>
|
||||
public string Os => UserAgentParser.Create(CreatedUserAgent).Platform;
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ApiId" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ApiId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 接口描述
|
||||
/// </summary>
|
||||
public string ApiSummary { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.CreatedClientIp" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override int? CreatedClientIp { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedTime.CreatedTime" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override DateTime CreatedTime { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.CreatedUserAgent" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string CreatedUserAgent { get; init; }
|
||||
|
||||
/// <inheritdoc cref="IFieldCreatedUser.CreatedUserName" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string CreatedUserName { get; set; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.Duration" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override long Duration { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ErrorCode" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override ErrorCodes ErrorCode { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.Exception" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Exception { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ExtraData" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ExtraData { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.HttpStatusCode" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.Never)]
|
||||
public override int HttpStatusCode { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.Method" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string Method { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ReferUrl" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ReferUrl { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.RequestBody" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string RequestBody { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.RequestContentType" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string RequestContentType { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.RequestHeaders" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string RequestHeaders { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.RequestUrl" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string RequestUrl { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ResponseBody" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ResponseBody { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ResponseContentType" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ResponseContentType { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ResponseHeaders" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override string ResponseHeaders { get; init; }
|
||||
|
||||
/// <inheritdoc cref="Sys_RequestLog.ServerIp" />
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public override int? ServerIp { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Register(TypeAdapterConfig config)
|
||||
{
|
||||
_ = config.ForType<Sys_RequestLog, QueryRequestLogRsp>().Map(dest => dest.ApiSummary, src => src.Api.Summary);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user