51 lines
2.5 KiB
C#
51 lines
2.5 KiB
C#
using SqlSugar;
|
||
|
||
namespace Model.Entity.System
|
||
{
|
||
/// <summary>
|
||
/// 文件上传记录表(每次上传都登记:来源 Provider、业务类型、访问 URL)
|
||
/// </summary>
|
||
[SugarTable("sys_file_record")]
|
||
public class FileRecordEntity : BaseEntity
|
||
{
|
||
/// <summary>存储后的文件名(含相对路径,如 2026/09/18/snowflake.jpg)</summary>
|
||
[SugarColumn(ColumnName = "FileName", ColumnDescription = "存储文件名(含相对路径)", Length = 255, IsNullable = false)]
|
||
public string FileName { get; set; }
|
||
|
||
/// <summary>原始文件名(用户上传时的文件名)</summary>
|
||
[SugarColumn(ColumnName = "OriginalName", ColumnDescription = "原始文件名", Length = 255, IsNullable = true)]
|
||
public string? OriginalName { get; set; }
|
||
|
||
/// <summary>访问 URL(Endpoint + 相对路径)</summary>
|
||
[SugarColumn(ColumnName = "Url", ColumnDescription = "访问URL", Length = 500, IsNullable = true)]
|
||
public string? Url { get; set; }
|
||
|
||
/// <summary>文件大小(字节)</summary>
|
||
[SugarColumn(ColumnName = "Size", ColumnDescription = "文件大小(字节)")]
|
||
public long Size { get; set; }
|
||
|
||
/// <summary>扩展名(含点,如 .jpg)</summary>
|
||
[SugarColumn(ColumnName = "Ext", ColumnDescription = "扩展名", Length = 20, IsNullable = true)]
|
||
public string? Ext { get; set; }
|
||
|
||
/// <summary>使用的存储 Provider(冗余,便于排查)</summary>
|
||
[SugarColumn(ColumnName = "Provider", ColumnDescription = "存储Provider", Length = 20, IsNullable = true)]
|
||
public string? Provider { get; set; }
|
||
|
||
/// <summary>使用的存储配置Id(关联 sys_file_storage.Id)</summary>
|
||
public long StorageId { get; set; }
|
||
|
||
/// <summary>上传人</summary>
|
||
[SugarColumn(ColumnName = "Uploader", ColumnDescription = "上传人", Length = 50, IsNullable = true)]
|
||
public string? Uploader { get; set; }
|
||
|
||
/// <summary>业务类型(equipment_attachment/qrcode/generic 等,便于按业务查询)</summary>
|
||
[SugarColumn(ColumnName = "BizType", ColumnDescription = "业务类型", Length = 50, IsNullable = true)]
|
||
public string? BizType { get; set; }
|
||
|
||
/// <summary>业务Id(关联业务实体的 Id,可空)</summary>
|
||
[SugarColumn(ColumnName = "BizId", ColumnDescription = "业务Id", Length = 64, IsNullable = true)]
|
||
public string? BizId { get; set; }
|
||
}
|
||
}
|