Files
WMSlite/WmsLite.Api/Models/HttpAccessLog.cs
T
zhougfandCursor fa1b286463 Add WmsLite monorepo with JWT auth, tenant context, and project READMEs.
Implement API security baseline (sys_user, JWT, audit fields, transactions,
unique constraints) and Web real login with 401 handling. Document setup
and development workflows in root, WmsLite.Api, and WmsLite.Web README files.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 14:17:47 +08:00

47 lines
1.7 KiB
C#

using SqlSugar;
namespace WmsLite.Api.Models;
/// <summary>
/// HTTP 访问日志(仅落库请求/响应文本,不包含 SQL)。
/// </summary>
[SugarTable("http_access_log")]
public class HttpAccessLog
{
[SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = false)]
public long Id { get; set; }
[SugarColumn(ColumnName = "trace_id", Length = 64, IsNullable = false)]
public string TraceId { get; set; } = string.Empty;
[SugarColumn(ColumnName = "http_method", Length = 16, IsNullable = false)]
public string HttpMethod { get; set; } = string.Empty;
[SugarColumn(ColumnName = "path", Length = 512, IsNullable = false)]
public string Path { get; set; } = string.Empty;
[SugarColumn(ColumnName = "query_string", ColumnDataType = "text", IsNullable = true)]
public string? QueryString { get; set; }
[SugarColumn(ColumnName = "status_code", IsNullable = false)]
public int StatusCode { get; set; }
[SugarColumn(ColumnName = "request_body", ColumnDataType = "text", IsNullable = true)]
public string? RequestBody { get; set; }
[SugarColumn(ColumnName = "response_body", ColumnDataType = "text", IsNullable = true)]
public string? ResponseBody { get; set; }
[SugarColumn(ColumnName = "duration_ms", IsNullable = true)]
public int? DurationMs { get; set; }
[SugarColumn(ColumnName = "client_ip", Length = 64, IsNullable = true)]
public string? ClientIp { get; set; }
[SugarColumn(ColumnName = "user_id", Length = 128, IsNullable = true)]
public string? UserId { get; set; }
[SugarColumn(ColumnName = "create_time", IsNullable = true)]
public DateTime? CreateTime { get; set; }
}