Files
emall-api/FutureMailAPI/DTOs/FileUploadDTOs.cs
2025-10-16 09:56:36 +08:00

47 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
}
}