修改路径
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
abeda7820d
commit
78c46572a2
|
@ -545,13 +545,23 @@ public class OSSService : IOSSService
|
|||
/// <param name="overwrite">是否覆盖已存在的目标文件(默认true)</param>
|
||||
public void MoveObject(string sourcePath, string destPath, bool overwrite = true)
|
||||
{
|
||||
|
||||
GetObjectStoreTempToken();
|
||||
var aliConfig = ObjectStoreServiceOptions.AliyunOSS;
|
||||
|
||||
var client = new OssClient(RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? aliConfig.EndPoint : aliConfig.InternalEndpoint, AliyunOSSTempToken.AccessKeyId, AliyunOSSTempToken.AccessKeySecret, AliyunOSSTempToken.SecurityToken);
|
||||
|
||||
|
||||
if (sourcePath.StartsWith("/"))
|
||||
{
|
||||
sourcePath = sourcePath.Substring(1);
|
||||
}
|
||||
|
||||
|
||||
if (destPath.StartsWith("/"))
|
||||
{
|
||||
destPath = destPath.Substring(1);
|
||||
}
|
||||
|
||||
var sourceBucket = aliConfig.BucketName;
|
||||
var sourceKey = sourcePath;
|
||||
|
||||
|
@ -565,9 +575,16 @@ public class OSSService : IOSSService
|
|||
// 检查目标是否存在(当不允许覆盖时)
|
||||
if (!overwrite && client.DoesObjectExist(destBucket, destKey))
|
||||
{
|
||||
throw new InvalidOperationException("File exist");
|
||||
throw new InvalidOperationException("File Exist");
|
||||
}
|
||||
|
||||
|
||||
//var copyRequest = new Aliyun.OSS.CopyObjectRequest(sourceBucket, sourceKey, sourceBucket, destKey);
|
||||
//var result = client.CopyObject(copyRequest);
|
||||
|
||||
//// 2. 删除原文件(可选,根据是否需要保留原文件)
|
||||
//client.DeleteObject(sourceBucket, sourceKey);
|
||||
|
||||
// 执行复制
|
||||
var copyRequest = new Aliyun.OSS.CopyObjectRequest(
|
||||
sourceBucket, sourceKey,
|
||||
|
|
|
@ -1054,7 +1054,7 @@
|
|||
医生文档关联关系维护
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Attachment},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Enroll},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Doctor},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Attachment},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Enroll},IRaCIS.Core.Application.Helper.IOSSService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Doctor},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
医生文档关联关系维护
|
||||
</summary>
|
||||
|
@ -1110,7 +1110,7 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.DeleteAttachment(System.Guid)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.DeleteAttachment(IRaCIS.Application.Contracts.DeleteAttachment)">
|
||||
<summary>
|
||||
删除
|
||||
</summary>
|
||||
|
@ -1124,6 +1124,13 @@
|
|||
<param name="attachmentList"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.UpdateTrialAttachments(IRaCIS.Application.Contracts.AttachmentDTO)">
|
||||
<summary>
|
||||
更新医生资质
|
||||
</summary>
|
||||
<param name="attachment"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.SaveAttachments(System.Collections.Generic.IEnumerable{IRaCIS.Application.Contracts.AttachmentDTO})">
|
||||
<summary>
|
||||
保存多个附件
|
||||
|
@ -13610,6 +13617,14 @@
|
|||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.MoveObject(System.String,System.String,System.Boolean)">
|
||||
<summary>
|
||||
移动OSS文件到新路径
|
||||
</summary>
|
||||
<param name="sourcePath">原文件路径(格式:bucket/key)</param>
|
||||
<param name="destPath">新文件路径(格式:bucket/key)</param>
|
||||
<param name="overwrite">是否覆盖已存在的目标文件(默认true)</param>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Helper.OSSService.GetRootFolderNames">
|
||||
<summary>
|
||||
获取所有根目录名称
|
||||
|
|
|
@ -220,7 +220,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var fileName= attachmentData.Path.Split("/").Last();
|
||||
|
||||
|
||||
attachment.Path = $"/systemData/reviewe/{attachment.Type}/{attachment.DoctorId}/{fileName}`";
|
||||
attachment.Path = $"/systemData/reviewe/{attachment.Type}/{attachment.DoctorId}/{fileName}";
|
||||
|
||||
_oSSService.MoveObject(attachmentData.Path, attachment.Path);
|
||||
|
||||
|
|
Loading…
Reference in New Issue