Created appsettings class to pull from appsettings.json files

This commit is contained in:
Daniel Wathen
2023-01-17 15:25:20 -07:00
parent 7cde09d7b8
commit 94ea7502a3
14 changed files with 341 additions and 74 deletions

View File

@ -2,20 +2,23 @@
using ReportingServices.Shared.HelperClasses;
using ReportingServices.Shared.Models.ProductionReport;
using ReportingServices.Shared.ViewModels.ProductionReport;
using ReportingServices.UI.Models;
namespace ReportingServices.UI.Controllers;
public class ProductionReportController : Controller
{
private readonly ILogger<ProductionReportController> _logger;
private readonly string _dailyRptFilePath = "wwwroot/Assets/DailyReportInfo.json";
private readonly string _toolStateOwnerFilePath = "wwwroot/Assets/ToolStates.json";
private readonly string _dailyRptFilePath;
private readonly string _toolStateOwnerFilePath;
private readonly string _baseDBUrl;
public ProductionReportController(ILogger<ProductionReportController> logger)
public ProductionReportController(ILogger<ProductionReportController> logger, AppSettings appSettings)
{
_logger = logger;
_baseDBUrl = "http://localhost:50201/api/ScrapeDB/";
_baseDBUrl = appSettings.BaseAPIAddress;
_dailyRptFilePath = appSettings.DailyReportFilePath;
_toolStateOwnerFilePath = appSettings.ToolStateOwnerFilePath;
_logger.LogInformation("Base Database Address: {baseUrl}", _baseDBUrl);
}