| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 先删除后新增 |
| | | [HttpPost] |
| | | public async Task<IActionResult> AddAfterDeleteAsync([FromBody] ApiAction action) |
| | | { |
| | | ApiAction response; |
| | | try |
| | | { |
| | | response = action.GetResponse(await Biz.Base.AddAfterDeleteAsync(action.GetDataEntity())); |
| | | } |
| | | catch (System.Exception ex) |
| | | { |
| | | response = action.GetResponse().CatchExceptionWithLog(ex); |
| | | } |
| | | return Ok(response); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 文件上传 |
| | | /// <summary> |
| | | /// 文件上传 |
| | | /// </summary> |
| | | /// <param name="file"></param> |
| | | /// <param name="entityName"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<IActionResult> Upload(IFormFile file) |
| | | public async Task<IActionResult> Upload([FromForm]string entityName, IFormFile file) |
| | | { |
| | | if (file == null || file.Length == 0) |
| | | return BadRequest("No file uploaded."); |
| | | |
| | | var path = Path.Combine(@"D:\nginx-1.26.0\html", "upload", file.FileName); |
| | | var folderName = entityName == "BAS_LABEL_TEMP" || entityName == "BAS_LABEL_VAR" ? "upload/Template": "upload"; |
| | | var path = Path.Combine($@"{BizConfig.Configuration["UploadAddress"]}", folderName, file.FileName); |
| | | |
| | | using (var stream = new FileStream(path, FileMode.Create)) |
| | | { |