Обновление Сервиса

parent 3f583117
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NLog.Extensions.Logging; using NLog.Extensions.Logging;
using ProfitGroup.SampleNotifyService.Core.Auth; using ProfitGroup.NotifyService.Core.Auth;
using ProfitGroup.SampleNotifyService.Core.Handlers; using ProfitGroup.NotifyService.Core.Handlers;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using ProfitGroup.SampleNotifyService.Services; using ProfitGroup.NotifyService.Services;
namespace ProfitGroup.SampleNotifyService.Core.Application namespace ProfitGroup.NotifyService.Core.Application
{ {
public static class Extensions public static class Extensions
{ {
...@@ -39,7 +39,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Application ...@@ -39,7 +39,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Application
(options => options.UseSqlServer(builder.Configuration.GetConnectionString("RnDConnection"))); (options => options.UseSqlServer(builder.Configuration.GetConnectionString("RnDConnection")));
builder.Services.AddTransient<Handlers.RouteHandler>(); builder.Services.AddTransient<Handlers.RouteHandler>();
builder.Services.AddTransient<INotifyService, NotifyService>(); builder.Services.AddTransient<INotifyService, Services.NotifyService>();
builder.Services.AddAuthorization(); builder.Services.AddAuthorization();
......
...@@ -13,7 +13,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Auth ...@@ -13,7 +13,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Auth
public BasicAuthenticationHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) public BasicAuthenticationHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock)
{ {
this._logger = logger.CreateLogger<BasicAuthenticationHandler>(); _logger = logger.CreateLogger<BasicAuthenticationHandler>();
} }
protected override Task<AuthenticateResult> HandleAuthenticateAsync() protected override Task<AuthenticateResult> HandleAuthenticateAsync()
...@@ -32,10 +32,10 @@ namespace ProfitGroup.SampleNotifyService.Core.Auth ...@@ -32,10 +32,10 @@ namespace ProfitGroup.SampleNotifyService.Core.Auth
var username = credentials[0]; var username = credentials[0];
var password = credentials[1]; var password = credentials[1];
_logger.LogInformation($"Login: {username}, Password: {password}");
if (IsValidUser(username, password)) if (IsValidUser(username, password))
{ {
_logger.LogInformation("Успешная авторизация");
var claims = new[] { new Claim(ClaimTypes.Name, username) }; var claims = new[] { new Claim(ClaimTypes.Name, username) };
var identity = new ClaimsIdentity(claims, Scheme.Name); var identity = new ClaimsIdentity(claims, Scheme.Name);
var principal = new ClaimsPrincipal(identity); var principal = new ClaimsPrincipal(identity);
...@@ -43,11 +43,10 @@ namespace ProfitGroup.SampleNotifyService.Core.Auth ...@@ -43,11 +43,10 @@ namespace ProfitGroup.SampleNotifyService.Core.Auth
return Task.FromResult(AuthenticateResult.Success(ticket)); return Task.FromResult(AuthenticateResult.Success(ticket));
} }
else
{ _logger.LogInformation($"Произошла ошибка при авторизации. Указан неверный логин или пароль");
return Task.FromResult(AuthenticateResult.Fail("Incorrect login or password")); return Task.FromResult(AuthenticateResult.Fail("Incorrect login or password"));
} }
}
catch (Exception ex) catch (Exception ex)
{ {
return Task.FromResult(AuthenticateResult.Fail("Error: " + ex.Message)); return Task.FromResult(AuthenticateResult.Fail("Error: " + ex.Message));
...@@ -56,11 +55,13 @@ namespace ProfitGroup.SampleNotifyService.Core.Auth ...@@ -56,11 +55,13 @@ namespace ProfitGroup.SampleNotifyService.Core.Auth
private bool IsValidUser(string username, string password) private bool IsValidUser(string username, string password)
{ {
#if DEBUG // ToDo: Сменить пароль при переносе решения
return username == "S4test" && password == "ST6aAFw10";
#endif // APP02
return username == "S4test" && password == "lMxeTqMIH04R8mCE";
return username == "S4test" && password == "ST6aAFw10"; // Productive
// return username == "S4test" && password == "lMxeTqMIH04R8mCE";
} }
} }
} }
using ProfitGroup.SampleNotifyService.Models; using ProfitGroup.NotifyService.Models;
namespace ProfitGroup.SampleNotifyService.Core.Configs namespace ProfitGroup.NotifyService.Core.Configs
{ {
public class Config public class Config
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class ProfITS4MtLogConfiguration : IEntityTypeConfiguration<ProfITS4MtLog> public partial class ProfITS4MtLogConfiguration : IEntityTypeConfiguration<ProfITS4MtLog>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class ProfITS4PrLogConfiguration : IEntityTypeConfiguration<ProfITS4PrLog> public partial class ProfITS4PrLogConfiguration : IEntityTypeConfiguration<ProfITS4PrLog>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class RndtAuConfiguration : IEntityTypeConfiguration<RndtAu> public partial class RndtAuConfiguration : IEntityTypeConfiguration<RndtAu>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class RndtBomHeaderConfiguration : IEntityTypeConfiguration<RndtBomHeader> public partial class RndtBomHeaderConfiguration : IEntityTypeConfiguration<RndtBomHeader>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class RndtScConfiguration : IEntityTypeConfiguration<RndtSc> public partial class RndtScConfiguration : IEntityTypeConfiguration<RndtSc>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class RndtScIcConfiguration : IEntityTypeConfiguration<RndtScIc> public partial class RndtScIcConfiguration : IEntityTypeConfiguration<RndtScIc>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class RndtScIiConfiguration : IEntityTypeConfiguration<RndtScIi> public partial class RndtScIiConfiguration : IEntityTypeConfiguration<RndtScIi>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class RndtSpAuConfiguration : IEntityTypeConfiguration<RndtSpAu> public partial class RndtSpAuConfiguration : IEntityTypeConfiguration<RndtSpAu>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class RndtSpConfiguration : IEntityTypeConfiguration<RndtSp> public partial class RndtSpConfiguration : IEntityTypeConfiguration<RndtSp>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class RndtSpIcConfiguration : IEntityTypeConfiguration<RndtSpIc> public partial class RndtSpIcConfiguration : IEntityTypeConfiguration<RndtSpIc>
{ {
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations namespace ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations
{ {
public partial class RndtSpIiConfiguration : IEntityTypeConfiguration<RndtSpIi> public partial class RndtSpIiConfiguration : IEntityTypeConfiguration<RndtSpIi>
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class ProfITS4MtLog public partial class ProfITS4MtLog
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class ProfITS4PrLog public partial class ProfITS4PrLog
{ {
......
// <auto-generated> This file has been auto generated by EF Core Power Tools. </auto-generated> // <auto-generated> This file has been auto generated by EF Core Power Tools. </auto-generated>
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities.Configurations; using ProfitGroup.NotifyService.Data.Core.Data.Entities.Configurations;
using System.Collections.Generic; using System.Collections.Generic;
using System; using System;
#nullable disable #nullable disable
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RDnLDatabaseContext : DbContext public partial class RDnLDatabaseContext : DbContext
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RndtAu public partial class RndtAu
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RndtBomHeader public partial class RndtBomHeader
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RndtSc public partial class RndtSc
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RndtScIc public partial class RndtScIc
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RndtScIi public partial class RndtScIi
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RndtSp public partial class RndtSp
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RndtSpAu public partial class RndtSpAu
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RndtSpIc public partial class RndtSpIc
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ProfitGroup.SampleNotifyService.Data.Core.Data.Entities namespace ProfitGroup.NotifyService.Data.Core.Data.Entities
{ {
public partial class RndtSpIi public partial class RndtSpIi
{ {
......
using System.Text; using System.Text;
namespace ProfitGroup.SampleNotifyService.Core.Handlers namespace ProfitGroup.NotifyService.Core.Handlers
{ {
public static class BodyParser public static class BodyParser
{ {
......
using System.Xml.Serialization; using System.Xml.Serialization;
namespace ProfitGroup.SampleNotifyService.Core.Handlers namespace ProfitGroup.NotifyService.Core.Handlers
{ {
public static class ContentDeserializer public static class ContentDeserializer
{ {
......
namespace ProfitGroup.SampleNotifyService.Core.Handlers; namespace ProfitGroup.NotifyService.Core.Handlers;
public class RequestScopedLoggerMiddleware public class RequestScopedLoggerMiddleware
{ {
......
using ProfitGroup.SampleNotifyService.Core.Configs; using System.Text;
using ProfitGroup.SampleNotifyService.Models;
using ProfitGroup.SampleNotifyService.Services;
using System.Text;
using System.Xml.Serialization; using System.Xml.Serialization;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Core.Configs;
using ProfitGroup.NotifyService.Models;
using ProfitGroup.NotifyService.Services;
using ProfitGroup.NotifyService.Data.Core.Data.Entities;
namespace ProfitGroup.SampleNotifyService.Core.Handlers namespace ProfitGroup.NotifyService.Core.Handlers
{ {
public class RouteHandler public class RouteHandler
{ {
...@@ -73,7 +73,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers ...@@ -73,7 +73,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers
{ {
var confirmation = model.Body.MTConfirmation.Confirmation; var confirmation = model.Body.MTConfirmation.Confirmation;
var isSuccess = await _notifyService.SaveParameterLog(confirmation.ID, confirmation.Version, confirmation.StatusCode, confirmation.StatusText); var isSuccess = await _notifyService.SaveParameterLog(confirmation.ID, Convert.ToInt32(confirmation.Version), confirmation.StatusCode, confirmation.StatusText);
if (!isSuccess) if (!isSuccess)
{ {
...@@ -92,7 +92,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers ...@@ -92,7 +92,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers
{ {
var confirmation = model.Body.MTConfirmation.Confirmation; var confirmation = model.Body.MTConfirmation.Confirmation;
var isSuccess = await _notifyService.SaveMethodLog(confirmation.ID, confirmation.Version, confirmation.StatusCode, confirmation.StatusText); var isSuccess = await _notifyService.SaveMethodLog(confirmation.ID, Convert.ToInt32(confirmation.Version), confirmation.StatusCode, confirmation.StatusText);
if (!isSuccess) if (!isSuccess)
{ {
...@@ -121,7 +121,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers ...@@ -121,7 +121,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers
return Results.NotFound(errorText); return Results.NotFound(errorText);
} }
var infoCard = await _notifyService.GetSampleInfoCardAsync(confirmation.ID); var infoCard = await _notifyService.GetSampleInfoCardAsync((int)sample.SC);
if (infoCard == null) if (infoCard == null)
{ {
...@@ -160,10 +160,10 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers ...@@ -160,10 +160,10 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers
{ {
var errorText = $"Полученое неверное значение локации. Полученное значение: \"{locate}\""; var errorText = $"Полученое неверное значение локации. Полученное значение: \"{locate}\"";
_logger.LogError(errorText); _logger.LogError(errorText);
return Results.BadRequest($""); return Results.BadRequest(errorText);
} }
var specification = await _notifyService.GetSpecificationAsync(confirmation.ID, confirmation.Version); var specification = await _notifyService.GetSpecificationAsync(confirmation.ID, Convert.ToInt32(confirmation.Version));
if (specification == null) if (specification == null)
{ {
...@@ -174,7 +174,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers ...@@ -174,7 +174,7 @@ namespace ProfitGroup.SampleNotifyService.Core.Handlers
} }
var infoCard = var infoCard =
await _notifyService.GetSpecificationInfoCardAsync(confirmation.ID, confirmation.Version, locate); await _notifyService.GetSpecificationInfoCardAsync((int)specification.SP, Convert.ToInt32(confirmation.Version), locate);
if (infoCard == null) if (infoCard == null)
{ {
......
namespace ProfitGroup.SampleNotifyService.Models namespace ProfitGroup.NotifyService.Models
{ {
public enum AttributeSaveAction public enum AttributeSaveAction
{ {
......
using System.Xml.Serialization; using System.Xml.Serialization;
namespace ProfitGroup.SampleNotifyService.Models namespace ProfitGroup.NotifyService.Models
{ {
[XmlRoot(ElementName = "Confirmation", Namespace = "")] [XmlRoot(ElementName = "Confirmation", Namespace = "")]
public class Confirmation public class Confirmation
...@@ -16,7 +16,7 @@ namespace ProfitGroup.SampleNotifyService.Models ...@@ -16,7 +16,7 @@ namespace ProfitGroup.SampleNotifyService.Models
public int ID { get; set; } public int ID { get; set; }
[XmlAttribute(AttributeName = "Version", Namespace = "")] [XmlAttribute(AttributeName = "Version", Namespace = "")]
public int Version { get; set; } public string Version { get; set; }
[XmlAttribute(AttributeName = "StatusCode", Namespace = "")] [XmlAttribute(AttributeName = "StatusCode", Namespace = "")]
public string StatusCode { get; set; } public string StatusCode { get; set; }
......
namespace ProfitGroup.SampleNotifyService.Models namespace ProfitGroup.NotifyService.Models
{ {
public enum ObjectTypes public enum ObjectTypes
{ {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.4" /> <PackageReference Include="NLog.Extensions.Logging" Version="5.3.4" />
<PackageReference Include="NLog.Web" Version="5.3.5" /> <PackageReference Include="NLog.Web" Version="5.3.3" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.4" /> <PackageReference Include="NLog.Web.AspNetCore" Version="5.3.4" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup> </ItemGroup>
......
using ProfitGroup.SampleNotifyService.Core.Application; using ProfitGroup.NotifyService.Core.Application;
WebApplication WebApplication
.CreateBuilder(args) .CreateBuilder(args)
......
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
namespace ProfitGroup.SampleNotifyService.Services; namespace ProfitGroup.NotifyService.Services;
public interface INotifyService public interface INotifyService
{ {
......
using Microsoft.Data.SqlClient; using Microsoft.Data.SqlClient;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using ProfitGroup.SampleNotifyService.Core.Configs; using ProfitGroup.NotifyService.Core.Configs;
using ProfitGroup.SampleNotifyService.Data.Core.Data.Entities; using ProfitGroup.NotifyService.Data.Core.Data.Entities;
namespace ProfitGroup.SampleNotifyService.Services; namespace ProfitGroup.NotifyService.Services;
public class NotifyService : INotifyService public class NotifyService : INotifyService
{ {
...@@ -234,9 +234,9 @@ public class NotifyService : INotifyService ...@@ -234,9 +234,9 @@ public class NotifyService : INotifyService
}; };
await _context.Database.ExecuteSqlRawAsync( await _context.Database.ExecuteSqlRawAsync(
"UPDATE ProfITS4MtLog " + "UPDATE [RndSuite].[ProfITS4MtLog] " +
"SET S4Status = @StatusCode, S4StatusText = @StatusText, S4StatusDate = @StatusDate " + "SET [S4Status] = @StatusCode, [S4StatusText] = @StatusText, [S4StatusDate] = @StatusDate " +
"WHERE MT = @MethodId AND MT_VERSION = @MethodVersion", parameters); "WHERE [MT] = @MethodId AND [MT_VERSION] = @MethodVersion", parameters);
// await _context.SaveChangesAsync(); // await _context.SaveChangesAsync();
return true; return true;
} }
...@@ -275,9 +275,9 @@ public class NotifyService : INotifyService ...@@ -275,9 +275,9 @@ public class NotifyService : INotifyService
}; };
var affectedRows = await _context.Database.ExecuteSqlRawAsync( var affectedRows = await _context.Database.ExecuteSqlRawAsync(
"UPDATE ProfITS4PrLog " + "UPDATE [RndSuite].[ProfITS4PrLog] " +
"SET S4Status = @StatusCode, S4StatusText = @StatusText, S4StatusDate = @StatusDate " + "SET [S4Status] = @StatusCode, [S4StatusText] = @StatusText, [S4StatusDate] = @StatusDate " +
"WHERE PR = @ParameterId AND PR_VERSION = @ParameterVersion", parameters); "WHERE [PR] = @ParameterId AND [PR_VERSION] = @ParameterVersion", parameters);
// await _context.SaveChangesAsync(); // await _context.SaveChangesAsync();
return true; return true;
......
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace ProfitGroup.SampleService.Models.Entities
{
public partial class Rndtpack
{
public Nullable<int> lo { get; set; }
public string control { get; set; }
public string pack { get; set; }
public string pack_KSSS { get; set; }
public string pack_en { get; set; }
public string pack_cn { get; set; }
public string pack_au { get; set; }
public string pack_id { get; set; }
public int id { get; set; }
}
public class RndtpackMapObject
{
public decimal Id { get; set; }
public string Pack { get; set; }
public string PackKSSS { get; set; }
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
namespace ProfitGroup.SampleService.Models
{
public class StringWriterUTF8 : StringWriter
{
public override Encoding Encoding => Encoding.UTF8;
}
}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment