软著申请修改

This commit is contained in:
hehaibing-1996
2024-10-17 12:59:41 +08:00
parent 278b1eab04
commit baa7b9716c
181 changed files with 357 additions and 497 deletions

View File

@ -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安装包"
};
}
}