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

@ -25,16 +25,19 @@ namespace BMA.EHR.Retirement.Service.Controllers
private readonly ApplicationDBContext _context;
private readonly MinIOService _documentService;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly IConfiguration _configuration;
public RetirementController(RetirementRepository repository,
ApplicationDBContext context,
MinIOService documentService,
IConfiguration configuration,
IHttpContextAccessor httpContextAccessor)
{
_repository = repository;
_context = context;
_documentService = documentService;
_httpContextAccessor = httpContextAccessor;
_configuration = configuration;
}
#region " Properties "
@ -449,11 +452,13 @@ namespace BMA.EHR.Retirement.Service.Controllers
return Error(GlobalMessages.RetirementHistoryNotFound, 404);
using (var client = new HttpClient())
{
var url = $"https://s3cluster.frappet.com/bma-ehr-fpt/{profileHistorys.ProfileFile}.json";
// var Endpoint = _configuration["MinIO:Endpoint"];
// var BucketName = _configuration["MinIO:BucketName"];
var url = await _documentService.ImagesPathByName($"{profileHistorys.ProfileFile}.json");
// var url = $"{Endpoint}{BucketName}/{profileHistorys.ProfileFile}.json";
var responseTask = client.GetAsync(url);
var results = responseTask.Result;
var filehis = profileHistorys.Document == null ? null : await _documentService.ImagesPath(profileHistorys.Document.Id);
// Console.WriteLine(results.Content.ReadAsStringAsync().Result);
return Success(new { Json = true, profileHistorys.Id, profileHistorys.CreatedAt, profileHistorys.Year, profileHistorys.Round, profileHistorys.Type, profileHistorys.TypeReport, profile = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ProfileJsonRequest>>(results.Content.ReadAsStringAsync().Result), File = filehis });
}
}

View file

@ -27,10 +27,10 @@
}
},
"MinIO": {
"Endpoint": "https://s3cluster.frappet.com/",
"Endpoint": "https://s3.frappet.com/",
"AccessKey": "frappet",
"SecretKey": "FPTadmin2357",
"BucketName": "bma-ehr-fpt"
"SecretKey": "P@ssw0rd",
"BucketName": "bma-recruit"
},
"Protocol": "HTTPS"
}