fix 代码合并,minio上传文件
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
using Dlhis.Common.FileOperation.Request;
|
||||
using Dlhis.Common.FileOperation.Response;
|
||||
using Dlhis.Common.FileOperation.Services;
|
||||
using Dlhis.Common.Request;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Common.FileOperation.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// 文件上传/下载
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class ApkFileController : ControllerBase
|
||||
{
|
||||
private IApkFIileService _apkFIileService;
|
||||
|
||||
public ApkFileController(IApkFIileService apkFIileService)
|
||||
{
|
||||
_apkFIileService = apkFIileService;
|
||||
}
|
||||
/// <summary>
|
||||
/// minlo文件上传
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("minlo")]
|
||||
public async Task<ApkFileResponse> FormSingleFileUpload([FromForm] ApkRequest request)
|
||||
{
|
||||
return await _apkFIileService.FormSingleFileUpload(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// minlo文件下载
|
||||
/// </summary>
|
||||
/// <param name="fileName"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("url")]
|
||||
public async Task<string> RequestDownloadFile(string fileName)
|
||||
{
|
||||
return await _apkFIileService.RequestDownloadFile(fileName);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 本地文件上传
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("local")]
|
||||
[RequestSizeLimit(100_000_0000)]
|
||||
|
||||
public async Task<ApkFileResponse> FormLocalFileUpload([FromForm] ApkRequest request)
|
||||
{
|
||||
return await _apkFIileService.FormLocalFileUpload(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 本地文件下载
|
||||
/// </summary>
|
||||
/// <param name="filePath"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("local")]
|
||||
public IActionResult FormLocalDownloadFile(string filePath)
|
||||
{
|
||||
return _apkFIileService.FormLocalDownloadFile(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user