feat(all): в таблицу Order добавлено поле ExpirationDate, обновлены сервисы для записи этого поля. Начало логики закрытия нарядов в ЕСПП.
This commit is contained in:
@@ -8,7 +8,8 @@ namespace PARR.BLL
|
||||
{
|
||||
public static class ParrBllInstaller
|
||||
{
|
||||
public static void InstallBllServices(this IServiceCollection services, IConfiguration configuration) {
|
||||
public static void InstallBllServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
|
||||
var storageSettings = new StorageSettings();
|
||||
configuration.GetSection(nameof(StorageSettings)).Bind(storageSettings);
|
||||
@@ -17,6 +18,7 @@ namespace PARR.BLL
|
||||
|
||||
services.AddTransient<IFileService, FileService>();
|
||||
services.AddTransient<IMqService, MqService>();
|
||||
services.AddTransient<ITransformService, TransformService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
30
PARR.BLL/Services/Implementations/TransformService.cs
Normal file
30
PARR.BLL/Services/Implementations/TransformService.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using PARR.BLL.Services.Interfaces;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace PARR.BLL.Services.Implementations
|
||||
{
|
||||
internal class TransformService: ITransformService
|
||||
{
|
||||
private readonly ILogger<TransformService> logger;
|
||||
|
||||
public TransformService(ILogger<TransformService> logger)
|
||||
{
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public T? GetModelFromJson<T>(string str)
|
||||
{
|
||||
try
|
||||
{
|
||||
return JsonSerializer.Deserialize<T>(str);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, $"Ошибка при конвертации строки в модель. {str}");
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
PARR.BLL/Services/Interfaces/ITransformService.cs
Normal file
7
PARR.BLL/Services/Interfaces/ITransformService.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PARR.BLL.Services.Interfaces
|
||||
{
|
||||
public interface ITransformService
|
||||
{
|
||||
T? GetModelFromJson<T>(string str);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user