29-11-23
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using DigitalData.Modules.Logging;
|
||||
using EnvelopeGenerator.Common;
|
||||
using EnvelopeGenerator.Web.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using static EnvelopeGenerator.Web.Constants;
|
||||
@@ -9,6 +10,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
internal DatabaseService database;
|
||||
internal LogConfig logConfig;
|
||||
internal State state;
|
||||
public Logger logger;
|
||||
|
||||
public BaseController(DatabaseService database, LoggingService logging)
|
||||
@@ -16,6 +18,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
this.database = database;
|
||||
this.logConfig = logging.LogConfig;
|
||||
this.logger = logging.LogConfig.GetLoggerFor(GetType().Name);
|
||||
this.state = GetState();
|
||||
}
|
||||
|
||||
internal ObjectResult ErrorResponse(Exception e)
|
||||
@@ -26,5 +29,15 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
detail: e.Message,
|
||||
type: ErrorType.ServerError.ToString());
|
||||
}
|
||||
|
||||
internal State GetState()
|
||||
{
|
||||
return new State
|
||||
{
|
||||
Database = database.MSSQL,
|
||||
LogConfig = logConfig,
|
||||
UserId = 2 // TODO
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user