feat: 文传易匿名临时文件传输站初始版本

- 后端 .NET 8 + FreeSql + 阿里云 OSS,支持共享/私密/标签三种文件模式
- 前端 Vue3 + Vite + TDesign,上传/取件/管理三页
- 取件码/二维码/海报合成(含保存二维码为图片)
- deploy/ 部署文档与一键 FTP 发布脚本
- appsettings.json 含真实凭据,已 gitignore 不入库
This commit is contained in:
2026-08-24 00:03:28 +08:00
commit 1bfc72f9cb
40 changed files with 6849 additions and 0 deletions
+63
View File
@@ -0,0 +1,63 @@
using FreeSql.DataAnnotations;
namespace WenChuanyi.Api.Models;
/// <summary>文件记录(files 表,FreeSql CodeFirst 自动建表)</summary>
[Table(Name = "files")]
[Index("uk_pickcode", nameof(PickCode), true)]
[Index("uk_admincode", nameof(AdminCode), true)]
[Index("idx_tag", nameof(Tag))]
public class FileItem
{
[Column(IsPrimary = true, IsIdentity = true)]
public long Id { get; set; }
/// <summary>取件码(共享 8 位 / 私密 6 位),唯一索引</summary>
[Column(StringLength = 8)]
public string PickCode { get; set; } = null!;
/// <summary>管理码 8 位字母数字,唯一索引</summary>
[Column(StringLength = 8)]
public string AdminCode { get; set; } = null!;
/// <summary>standard(无密码无标签)/ private(有密码)/ tagged(仅标签)</summary>
[Column(StringLength = 10)]
public string FileType { get; set; } = null!;
/// <summary>私密文件 4-12 位密码(可同时设置标签,不互斥)</summary>
[Column(StringLength = 12)]
public string? Password { get; set; }
/// <summary>标签(仅英文+数字),普通索引(非唯一,一对多),可与密码同时设置</summary>
[Column(StringLength = 32)]
public string? Tag { get; set; }
/// <summary>原始文件名(下载展示)</summary>
[Column(StringLength = 255)]
public string OriginalName { get; set; } = null!;
/// <summary>OSS 对象键:文传易2026/{yyyyMM}/{Guid}{ext}</summary>
[Column(StringLength = 255)]
public string ObjectKey { get; set; } = null!;
/// <summary>字节数</summary>
public long Size { get; set; }
[Column(StringLength = 100)]
public string? MimeType { get; set; }
/// <summary>下载次数(仅统计、不限制)</summary>
public int DownloadCount { get; set; }
/// <summary>上传者 IPIPv4/IPv6,安全审计,仅管理列表展示)</summary>
[Column(StringLength = 45)]
public string? UploadIp { get; set; }
/// <summary>含标签(无论是否设密码)强制 true(永久保存,不自动过期)</summary>
public bool IsPermanent { get; set; }
/// <summary>过期时间(IsPermanent=true 时为 null</summary>
public DateTime? ExpiresAt { get; set; }
public DateTime CreatedAt { get; set; }
}