committed by
GitHub
20 changed files with 276 additions and 39 deletions
@ -1,18 +1,35 @@ |
|||||
using System.Threading.Tasks; |
using System; |
||||
using Volo.Abp.Application.Services; |
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Services; |
||||
using Volo.Abp.Content; |
using Volo.Abp.Content; |
||||
|
|
||||
namespace LINGYUN.Abp.OssManagement; |
namespace LINGYUN.Abp.OssManagement; |
||||
|
|
||||
public interface IOssObjectAppService : IApplicationService |
public interface IOssObjectAppService : IApplicationService |
||||
{ |
{ |
||||
Task<OssObjectDto> CreateAsync(CreateOssObjectInput input); |
Task<OssObjectDto> CreateAsync(CreateOssObjectInput input); |
||||
|
|
||||
Task<OssObjectDto> GetAsync(GetOssObjectInput input); |
Task<OssObjectDto> GetAsync(GetOssObjectInput input); |
||||
|
/// <summary>
|
||||
Task<IRemoteStreamContent> GetContentAsync(GetOssObjectInput input); |
/// 生成下载链接
|
||||
|
/// </summary>
|
||||
Task DeleteAsync(GetOssObjectInput input); |
/// <remarks>
|
||||
|
/// 由于a标签无法传递token, 由后端生成一次性下载链接
|
||||
Task BulkDeleteAsync(BulkDeleteOssObjectInput input); |
/// </remarks>
|
||||
} |
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
Task<string> GenerateUrlAsync(GetOssObjectInput input); |
||||
|
/// <summary>
|
||||
|
/// 下载文件
|
||||
|
/// </summary>
|
||||
|
/// <param name="urlKey">生成的一次性链接key</param>
|
||||
|
/// <returns></returns>
|
||||
|
Task<IRemoteStreamContent> DownloadAsync(string urlKey); |
||||
|
|
||||
|
[Obsolete("请使用 GenerateUrlAsync 与 DownloadAsync的组合")] |
||||
|
Task<IRemoteStreamContent> GetContentAsync(GetOssObjectInput input); |
||||
|
|
||||
|
Task DeleteAsync(GetOssObjectInput input); |
||||
|
|
||||
|
Task BulkDeleteAsync(BulkDeleteOssObjectInput input); |
||||
|
} |
||||
|
|||||
@ -0,0 +1,28 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
|
||||
|
namespace LINGYUN.Abp.OssManagement; |
||||
|
|
||||
|
public class ValidationOssObjectInput |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 总文件大小
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
public long TotalSize { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 文件名
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
public string FileName { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 容器
|
||||
|
/// </summary>
|
||||
|
[Required] |
||||
|
public string Bucket { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 路径
|
||||
|
/// </summary>
|
||||
|
public string Path { get; set; } |
||||
|
|
||||
|
public bool Overwrite { get; set; } |
||||
|
} |
||||
@ -0,0 +1,24 @@ |
|||||
|
namespace LINGYUN.Abp.OssManagement; |
||||
|
|
||||
|
public class OssObjectUrlCacheItem |
||||
|
{ |
||||
|
public string Url { get; set; } |
||||
|
|
||||
|
public string Bucket { get; set; } |
||||
|
|
||||
|
public string Path { get; set; } |
||||
|
|
||||
|
public string Object { get; set; } |
||||
|
public OssObjectUrlCacheItem() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public OssObjectUrlCacheItem(string url, string bucket, string path, string @object) |
||||
|
{ |
||||
|
Url = url; |
||||
|
Bucket = bucket; |
||||
|
Path = path; |
||||
|
Object = @object; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue