//
namespace SafeCampus.Web.Core;
///
/// 文件管理控制器
///
[ApiDescriptionSettings(Tag = "文件管理")]
[Route("sys/dev/[controller]")]
public class FileController : BaseController
{
private readonly IFileService _fileService;
public FileController(IFileService fileService)
{
_fileService = fileService;
}
///
/// 文件查询分页
///
///
///
[HttpGet("page")]
public async Task Page([FromQuery] FilePageInput input)
{
return await _fileService.Page(input);
}
///
/// 上传本地文件
///
///
///
[HttpPost("uploadLocal")]
[DisplayName("上传本地文件")]
[DisableRequestSizeLimit]
public async Task UploadLocal([FromForm] IFormFile file)
{
return await _fileService.UploadFile(SysDictConst.FILE_ENGINE_LOCAL, file);
}
///
/// 上传MINIO文件
///
///
///
[HttpPost("uploadMinio")]
[DisplayName("上传MINIO文件")]
[DisableRequestSizeLimit]
public async Task UploadMinio([FromForm] IFormFile file)
{
return await _fileService.UploadFile(SysDictConst.FILE_ENGINE_MINIO, file);
}
///
/// 删除文件
///
///
///
[HttpPost("delete")]
[DisplayName("删除文件")]
public async Task Delete([FromBody] BaseIdListInput input)
{
await _fileService.Delete(input);
}
///
/// 下载文件
///
///
///
[HttpGet("download")]
[DisplayName("下载文件")]
public async Task DownLoad([FromQuery] BaseIdInput input)
{
return await _fileService.Download(input);
}
}