You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

72 lines
2.8 KiB

using Microsoft.AspNetCore.Mvc;
using Znyc.Cloudcar.Admin.AspNetCore.Controllers;
using Znyc.Cloudcar.Admin.Security.Dtos;
using Znyc.Cloudcar.Admin.Security.Entitys;
using Znyc.Cloudcar.Admin.Security.IServices;
namespace Znyc.Cloudcar.Admin.WebApi.Controllers
{
/// <summary>
/// 文件管理
/// </summary>
[Route("api/Security/[controller]")]
[ApiController]
public class UploadFileController : AreaApiController<UploadFileEntity, UploadFileOutputDto, UploadFileInputDto,
IUploadFileService, long>
{
/// <summary>
/// </summary>
/// <param name="service"></param>
public UploadFileController(IUploadFileService service) : base(service)
{
_service = service;
}
///// <summary>
///// 异步批量物理删除
///// </summary>
///// <param name="info">主键Id数组</param>
//[HttpDelete("DeleteBatchAsync")]
//[FunctionAuthorize("Delete")]
//public override async Task<IActionResult> DeleteBatchAsync(DeletesInputDto info)
//{
// var result = new CommonResult();
// var where = string.Empty;
// where = "id in ('" + info.Ids.Join(",").Trim(',').Replace(",", "','") + "')";
// if (!string.IsNullOrEmpty(where))
// {
// var jobsId = info.Ids;
// foreach (var item in jobsId)
// {
// if (string.IsNullOrEmpty(item.ToString())) continue;
// UploadFile uploadFile = new UploadFileApp().Get(item.ToString());
// var cacheHelper = new CacheHelper();
// var sysSetting = cacheHelper.Get("SysSetting").ToJson().ToObject<SysSetting>();
// if (uploadFile != null)
// {
// if (System.IO.File.Exists(sysSetting.LocalPath + "/" + uploadFile.FilePath))
// System.IO.File.Delete(sysSetting.LocalPath + "/" + uploadFile.FilePath);
// if (!string.IsNullOrEmpty(uploadFile.Thumbnail))
// if (System.IO.File.Exists(sysSetting.LocalPath + "/" + uploadFile.Thumbnail))
// System.IO.File.Delete(sysSetting.LocalPath + "/" + uploadFile.Thumbnail);
// }
// }
// var bl = await _service.DeleteBatchWhereAsync(where).ConfigureAwait(false);
// if (bl)
// {
// result.ErrCode = ErrCode.successCode;
// result.ErrMsg = ErrCode.err0;
// }
// else
// {
// result.ErrMsg = ErrCode.err43003;
// result.ErrCode = "43003";
// }
// }
// return ToJsonContent(result);
//}
}
}