summary คิวรี่เครื่องราช

This commit is contained in:
DESKTOP-2S5P7D1\Windows 10 2023-09-05 19:44:44 +07:00
parent 561ef617b6
commit 52ab6ee6f7
8 changed files with 208 additions and 8 deletions

View file

@ -213,6 +213,28 @@ namespace BMA.EHR.Application.Repositories
return path;
}
public async Task<string> ImagesPathByName(string fileName)
{
var config = new AmazonS3Config
{
ServiceURL = _configuration["MinIO:Endpoint"],
ForcePathStyle = true
};
DateTime expires = DateTime.UtcNow.AddHours(6);
var _protocol = _configuration["Protocol"];
GetPreSignedUrlRequest request = new GetPreSignedUrlRequest
{
BucketName = _bucketName,
Key = fileName,
Expires = expires,
Protocol = _protocol == "HTTPS" ? Protocol.HTTPS : Protocol.HTTP
};
string path = _s3Client.GetPreSignedURL(request);
return path;
}
#endregion
public List<Guid> GetAllIdByRoot(Guid? id)