软著申请修改
This commit is contained in:
@ -20,12 +20,9 @@ namespace WCS.WebApi.Controllers
|
||||
[Route("[controller]")]
|
||||
public class FileDownLoadController : ControllerBase
|
||||
{
|
||||
|
||||
public FileDownLoadController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[HttpPost("uploadApp")]
|
||||
public async Task<ResponseBase> uploadApp([FromForm] IFormFile excelFile, [FromForm] string version, [FromForm] string content)
|
||||
{
|
||||
@ -75,7 +72,6 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
await excelFile.CopyToAsync(stream);
|
||||
}
|
||||
|
||||
#region 保存数据
|
||||
var appVersion = new AppVersion()
|
||||
{
|
||||
@ -85,7 +81,6 @@ namespace WCS.WebApi.Controllers
|
||||
};
|
||||
DbHelp.db.Insertable(appVersion).ExecuteCommand();
|
||||
#endregion
|
||||
|
||||
// 文件上传成功,返回成功信息
|
||||
return new ResponseCommon()
|
||||
{
|
||||
@ -103,20 +98,16 @@ namespace WCS.WebApi.Controllers
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("downloadApp")]
|
||||
public IActionResult downloadApp(string fileName)
|
||||
{
|
||||
// 这里是文件的物理路径,你需要根据实际情况提供
|
||||
var filePath = Path.Combine(Directory.GetCurrentDirectory(), $"Files/{fileName}");
|
||||
|
||||
// 检查文件是否存在
|
||||
if (!System.IO.File.Exists(filePath))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
// 获取文件流
|
||||
var stream = System.IO.File.OpenRead(filePath);
|
||||
// 设置HTTP响应头,使浏览器知道这是一个附件,应该下载而不是打开
|
||||
@ -134,7 +125,6 @@ namespace WCS.WebApi.Controllers
|
||||
FileInfo[] files = Directory.GetFiles(directoryPath, "*.APK")
|
||||
.Select(file => new FileInfo(file))
|
||||
.ToArray();
|
||||
|
||||
if (files == null || files.Length == 0)
|
||||
{
|
||||
return new ResponseCommon<string>()
|
||||
@ -160,7 +150,6 @@ namespace WCS.WebApi.Controllers
|
||||
Code = 201,
|
||||
Message = "服务器不存在App安装包"
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||
using System.Configuration;
|
||||
@ -88,7 +87,6 @@ namespace WebApi
|
||||
builder.Services.AddScoped<IWarningService, WarningService>();
|
||||
builder.Services.AddScoped<IInOutRecordService, InOutRecordService>();
|
||||
builder.Services.AddScoped<IUploadService, UploadService>();
|
||||
|
||||
builder.Services.AddScoped<ISingleLightService, SingleLightService>();
|
||||
builder.Services.AddScoped<IMXL4Service, MXL4Service>();
|
||||
|
||||
|
Reference in New Issue
Block a user