初始化
This commit is contained in:
47
FutureMailAPI/DTOs/FileUploadDTOs.cs
Normal file
47
FutureMailAPI/DTOs/FileUploadDTOs.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace FutureMailAPI.DTOs
|
||||
{
|
||||
public class FileUploadDto
|
||||
{
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
public string ContentType { get; set; } = string.Empty;
|
||||
public long FileSize { get; set; }
|
||||
public string FilePath { get; set; } = string.Empty;
|
||||
public string FileUrl { get; set; } = string.Empty;
|
||||
public string ThumbnailUrl { get; set; } = string.Empty;
|
||||
public AttachmentType Type { get; set; }
|
||||
}
|
||||
|
||||
public class FileUploadRequestDto
|
||||
{
|
||||
public AttachmentType Type { get; set; }
|
||||
public string? Category { get; set; } // 分类:avatar, attachment等
|
||||
}
|
||||
|
||||
public class FileUploadWithFileRequestDto : FileUploadRequestDto
|
||||
{
|
||||
public IFormFile File { get; set; } = null!;
|
||||
}
|
||||
|
||||
public class FileUploadResponseDto
|
||||
{
|
||||
public string FileId { get; set; } = string.Empty;
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
public string FileUrl { get; set; } = string.Empty;
|
||||
public string ThumbnailUrl { get; set; } = string.Empty;
|
||||
public long FileSize { get; set; }
|
||||
public string ContentType { get; set; } = string.Empty;
|
||||
public AttachmentType Type { get; set; }
|
||||
public DateTime UploadedAt { get; set; }
|
||||
}
|
||||
|
||||
public enum AttachmentType
|
||||
{
|
||||
IMAGE,
|
||||
VOICE,
|
||||
VIDEO,
|
||||
DOCUMENT,
|
||||
OTHER
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user