improvements, fixes, etc...
This commit is contained in:
parent
ef016d24ac
commit
08b373f0c7
|
|
@ -31,6 +31,7 @@ public class Transfer: IEntityGuid, IAcFullName, ITimeStampInfo, IProductForeign
|
||||||
|
|
||||||
public string? PaymentId { get; set; }
|
public string? PaymentId { get; set; }
|
||||||
//public virtual UserProductMapping? UserProductMapping { get; set; }
|
//public virtual UserProductMapping? UserProductMapping { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
[Newtonsoft.Json.JsonIgnore]
|
[Newtonsoft.Json.JsonIgnore]
|
||||||
public virtual List<TransferToDriver> TransferToDrivers { get; set; } = [];
|
public virtual List<TransferToDriver> TransferToDrivers { get; set; } = [];
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using AyCode.Services.SignalRs;
|
using AyCode.Services.SignalRs;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace TIAM.Services;
|
namespace TIAM.Services;
|
||||||
|
|
||||||
|
|
@ -36,13 +37,16 @@ public class SignalRTags : AcSignalRTags
|
||||||
public const int RemoveTransferToDriver = 28;
|
public const int RemoveTransferToDriver = 28;
|
||||||
|
|
||||||
public const int GetAddress = 29;
|
public const int GetAddress = 29;
|
||||||
|
|
||||||
//public const int GetAddresses = 30;
|
//public const int GetAddresses = 30;
|
||||||
public const int GetAddressesByContextId = 31;
|
public const int GetAddressesByContextId = 31;
|
||||||
|
|
||||||
public const int UpdateAddress = 32;
|
public const int UpdateAddress = 32;
|
||||||
//public const int AddAddress = 33;
|
//public const int AddAddress = 33;
|
||||||
//public const int RemoveAddress = 34;
|
//public const int RemoveAddress = 34;
|
||||||
|
|
||||||
public const int GetProfileById = 35;
|
public const int GetProfileById = 35;
|
||||||
|
|
||||||
//public const int GetProfiles = 36;
|
//public const int GetProfiles = 36;
|
||||||
//public const int GetProfileByContextId = 37;
|
//public const int GetProfileByContextId = 37;
|
||||||
public const int UpdateProfile = 38;
|
public const int UpdateProfile = 38;
|
||||||
|
|
@ -96,5 +100,4 @@ public class SignalRTags : AcSignalRTags
|
||||||
public const int GetTransferDestinationToProductsByTransferDestinationId = 96;
|
public const int GetTransferDestinationToProductsByTransferDestinationId = 96;
|
||||||
|
|
||||||
public const int GetAllLogItemsByFilterText = 100;
|
public const int GetAllLogItemsByFilterText = 100;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
|
using AyCode.Core.Helpers;
|
||||||
using DevExpress.Pdf.Native.BouncyCastle.Security;
|
using DevExpress.Pdf.Native.BouncyCastle.Security;
|
||||||
using TIAM.Entities.Emails;
|
using TIAM.Entities.Emails;
|
||||||
using TIAM.Services.Server;
|
using TIAM.Services.Server;
|
||||||
|
|
@ -138,7 +139,7 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
||||||
|
|
||||||
public async Task OnReceiveMessage(int messageTag, byte[]? message, int? requestId)
|
public async Task OnReceiveMessage(int messageTag, byte[]? message, int? requestId)
|
||||||
{
|
{
|
||||||
var logText = $"Server OnReceiveMessage; {nameof(messageTag)}: {messageTag}; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}";
|
var logText = $"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Server OnReceiveMessage; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}";
|
||||||
|
|
||||||
if (message is { Length: 0 }) _logger.Warning($"message.Length == 0! {logText}");
|
if (message is { Length: 0 }) _logger.Warning($"message.Length == 0! {logText}");
|
||||||
else _logger.Info(logText);
|
else _logger.Info(logText);
|
||||||
|
|
@ -151,7 +152,7 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
||||||
|
|
||||||
object[]? paramValues = null;
|
object[]? paramValues = null;
|
||||||
|
|
||||||
logText = $"Found dynamic method for the tag! tag: {messageTag}; method: {methodsByDeclaringObject.InstanceObject.GetType().Name}.{methodInfoModel.MethodInfo.Name}";
|
logText = $"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Found dynamic method for the tag! method: {methodsByDeclaringObject.InstanceObject.GetType().Name}.{methodInfoModel.MethodInfo.Name}";
|
||||||
|
|
||||||
if (methodInfoModel.ParamInfos is { Length: > 0 })
|
if (methodInfoModel.ParamInfos is { Length: > 0 })
|
||||||
{
|
{
|
||||||
|
|
@ -214,7 +215,7 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Debug($"Not found dynamic method for the tag! tag: {messageTag};");
|
_logger.Debug($"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Not found dynamic method for the tag! tag: {messageTag};");
|
||||||
|
|
||||||
switch (messageTag)
|
switch (messageTag)
|
||||||
{
|
{
|
||||||
|
|
@ -286,13 +287,13 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_logger.Error($"Server OnReceiveMessage; messageTag not found! messageTag: {messageTag}");
|
_logger.Error($"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Server OnReceiveMessage; messageTag not found!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Error($"Server OnReceiveMessage; {ex.Message}", ex);
|
_logger.Error($"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Server OnReceiveMessage; {ex.Message}", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Error), requestId);
|
await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Error), requestId);
|
||||||
|
|
@ -303,7 +304,7 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
||||||
|
|
||||||
protected async Task SendMessageToClient(ISignalRHubItemServer sendTo, int messageTag, ISignalRMessage message, int? requestId = null)
|
protected async Task SendMessageToClient(ISignalRHubItemServer sendTo, int messageTag, ISignalRMessage message, int? requestId = null)
|
||||||
{
|
{
|
||||||
_logger.Info($"Server SendMessageToClient; {nameof(messageTag)}: {messageTag}; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}");
|
_logger.Info($"{ConstHelper.NameByValue<SignalRTags>(messageTag)} Server SendMessageToClient; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}");
|
||||||
|
|
||||||
await sendTo.OnReceiveMessage(messageTag, message.ToMessagePack(ContractlessStandardResolver.Options), requestId);
|
await sendTo.OnReceiveMessage(messageTag, message.ToMessagePack(ContractlessStandardResolver.Options), requestId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,17 @@ using AyCode.Services.Loggers;
|
||||||
using AyCode.Services.SignalRs;
|
using AyCode.Services.SignalRs;
|
||||||
using MessagePack.Resolvers;
|
using MessagePack.Resolvers;
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
|
using TIAM.Services;
|
||||||
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
using TIAMWebApp.Shared.Application.Models.ClientSide;
|
||||||
using TIAMWebApp.Shared.Application.Utility;
|
using TIAMWebApp.Shared.Application.Utility;
|
||||||
|
|
||||||
namespace TIAMWebApp.Shared.Application.Services
|
namespace TIAMWebApp.Shared.Application.Services
|
||||||
{
|
{
|
||||||
public class AdminSignalRClient(IEnumerable<IAcLogWriterClientBase> logWriters) : AcSignalRClientBase($"{Setting.BaseUrl}/DevAdminHub", new LoggerClient(nameof(AdminSignalRClient), logWriters.ToArray()));
|
public class AdminSignalRClient : AcSignalRClientBase
|
||||||
|
{
|
||||||
|
public AdminSignalRClient(IEnumerable<IAcLogWriterClientBase> logWriters) : base($"{Setting.BaseUrl}/DevAdminHub", new LoggerClient(nameof(AdminSignalRClient), logWriters.ToArray()))
|
||||||
|
{
|
||||||
|
ConstHelper.NameByValue<SignalRTags>(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue