|
9 | 9 |
|
10 | 10 | namespace PrimeView.JsonFileReader |
11 | 11 | { |
12 | | - public class ReportReader : IReportReader |
| 12 | + public class ReportReader(string baseAddress, IConfiguration configuration) : IReportReader |
13 | 13 | { |
14 | 14 | private List<ReportSummary>? summaries; |
15 | 15 | private Dictionary<string, Report>? reportMap; |
16 | | - private readonly HttpClient httpClient; |
17 | | - private readonly string? indexFileName; |
18 | | - private readonly bool isS3Bucket; |
| 16 | + private readonly HttpClient httpClient = new() { BaseAddress = new Uri(configuration.GetValue(Constants.BaseURI, baseAddress) ?? baseAddress) }; |
| 17 | + private readonly string? indexFileName = configuration.GetValue<string?>(Constants.Index, null); |
| 18 | + private readonly bool isS3Bucket = configuration.GetValue(Constants.IsS3Bucket, false); |
19 | 19 | private bool haveJsonFilesLoaded = false; |
20 | 20 | private bool reachedMaxFileCount = false; |
21 | 21 | private int totalReports = 0; |
22 | 22 |
|
23 | | - public ReportReader(string baseAddress, IConfiguration configuration) |
24 | | - { |
25 | | - this.httpClient = new HttpClient { BaseAddress = new Uri(configuration.GetValue(Constants.BaseURI, baseAddress) ?? baseAddress) }; |
26 | | - this.indexFileName = configuration.GetValue<string?>(Constants.Index, null); |
27 | | - this.isS3Bucket = configuration.GetValue(Constants.IsS3Bucket, false); |
28 | | - } |
29 | | - |
30 | 23 | private async Task<Report?> LoadReportJsonFile(string fileName) |
31 | 24 | { |
32 | 25 | if (string.IsNullOrEmpty(fileName)) |
|
0 commit comments