修改文件路径
continuous-integration/drone/push Build is passing

This commit is contained in:
he
2025-03-17 10:50:21 +08:00
parent 2dac67618c
commit abeda7820d
2 changed files with 72 additions and 0 deletions
@@ -1,5 +1,6 @@
using IRaCIS.Application.Contracts;
using IRaCIS.Application.Interfaces;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.AspNetCore.Mvc;
@@ -14,6 +15,7 @@ namespace IRaCIS.Core.Application.Service
public class AttachmentService(IRepository<Attachment> _attachmentrepository,
IRepository<Dictionary> _dictionaryRepository,
IRepository<Enroll> _enrollRepository,
IOSSService _oSSService,
IRepository<Doctor> _doctorrepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IAttachmentService
{
@@ -211,6 +213,19 @@ namespace IRaCIS.Core.Application.Service
public async Task<IResponseOutput> UpdateTrialAttachments(AttachmentDTO attachment)
{
if (!attachment.Path.Contains(attachment.DoctorId.ToString()))
{
var attachmentData= await _attachmentrepository.FirstOrDefaultAsync(a => a.Id == attachment.Id);
var fileName= attachmentData.Path.Split("/").Last();
attachment.Path = $"/systemData/reviewe/{attachment.Type}/{attachment.DoctorId}/{fileName}`";
_oSSService.MoveObject(attachmentData.Path, attachment.Path);
}
if (attachment.DoctorId != null)
{
await _attachmentrepository.DeleteFromQueryAsync(a => a.DoctorId == attachment.DoctorId && a.Type == attachment.Type);