Files
emall-api/FutureMailAPI/DTOs/FileUploadDTOs.cs

47 lines
1.4 KiB
C#
Raw Normal View History

2025-10-16 09:56:36 +08:00
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
}
}