44 lines
928 B
C#
44 lines
928 B
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Fengling.AuthService.Models;
|
|
|
|
public class AccessLog
|
|
{
|
|
[Key]
|
|
public long Id { get; set; }
|
|
|
|
[MaxLength(50)]
|
|
public string? UserName { get; set; }
|
|
|
|
[MaxLength(50)]
|
|
public string? TenantId { get; set; }
|
|
|
|
[MaxLength(20)]
|
|
public string Action { get; set; } = string.Empty;
|
|
|
|
[MaxLength(200)]
|
|
public string? Resource { get; set; }
|
|
|
|
[MaxLength(10)]
|
|
public string? Method { get; set; }
|
|
|
|
[MaxLength(50)]
|
|
public string? IpAddress { get; set; }
|
|
|
|
[MaxLength(500)]
|
|
public string? UserAgent { get; set; }
|
|
|
|
[MaxLength(20)]
|
|
public string Status { get; set; } = "success";
|
|
|
|
public int Duration { get; set; }
|
|
|
|
public string? RequestData { get; set; }
|
|
|
|
public string? ResponseData { get; set; }
|
|
|
|
public string? ErrorMessage { get; set; }
|
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
}
|