Compare commits
No commits in common. "38bf25f42da668256d6d7f6b5d297bda90c1f689" and "ef016d24ac4877cb5c24ada82615741124659472" have entirely different histories.
38bf25f42d
...
ef016d24ac
|
|
@ -31,7 +31,6 @@ 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,5 +1,4 @@
|
||||||
using AyCode.Services.SignalRs;
|
using AyCode.Services.SignalRs;
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace TIAM.Services;
|
namespace TIAM.Services;
|
||||||
|
|
||||||
|
|
@ -37,16 +36,13 @@ 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;
|
||||||
|
|
@ -100,4 +96,5 @@ 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,7 +18,6 @@ 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;
|
||||||
|
|
@ -139,8 +138,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 tagName = ConstHelper.NameByValue<SignalRTags>(messageTag);
|
var logText = $"Server OnReceiveMessage; {nameof(messageTag)}: {messageTag}; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}";
|
||||||
var logText = $"Server OnReceiveMessage; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; {tagName}";
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
@ -153,11 +151,11 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
||||||
|
|
||||||
object[]? paramValues = null;
|
object[]? paramValues = null;
|
||||||
|
|
||||||
logText = $"Found dynamic method for the tag! method: {methodsByDeclaringObject.InstanceObject.GetType().Name}.{methodInfoModel.MethodInfo.Name}";
|
logText = $"Found dynamic method for the tag! tag: {messageTag}; method: {methodsByDeclaringObject.InstanceObject.GetType().Name}.{methodInfoModel.MethodInfo.Name}";
|
||||||
|
|
||||||
if (methodInfoModel.ParamInfos is { Length: > 0 })
|
if (methodInfoModel.ParamInfos is { Length: > 0 })
|
||||||
{
|
{
|
||||||
_logger.Debug($"{logText}({string.Join(", ", methodInfoModel.ParamInfos.Select(x => x.Name))}); {tagName}");
|
_logger.Debug($"{logText}({string.Join(", ", methodInfoModel.ParamInfos.Select(x => x.Name))})");
|
||||||
|
|
||||||
paramValues = new object[methodInfoModel.ParamInfos.Length];
|
paramValues = new object[methodInfoModel.ParamInfos.Length];
|
||||||
|
|
||||||
|
|
@ -209,14 +207,14 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
||||||
}
|
}
|
||||||
else paramValues[0] = message!.MessagePackTo<SignalPostJsonDataMessage<object>>(MessagePackSerializerOptions.Standard).PostDataJson.JsonTo(firstParamType)!;
|
else paramValues[0] = message!.MessagePackTo<SignalPostJsonDataMessage<object>>(MessagePackSerializerOptions.Standard).PostDataJson.JsonTo(firstParamType)!;
|
||||||
}
|
}
|
||||||
else _logger.Debug($"{logText}(); {tagName}");
|
else _logger.Debug($"{logText}()");
|
||||||
|
|
||||||
await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Success, methodInfoModel.MethodInfo.InvokeMethod(methodsByDeclaringObject.InstanceObject, paramValues)), requestId);
|
await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Success, methodInfoModel.MethodInfo.InvokeMethod(methodsByDeclaringObject.InstanceObject, paramValues)), requestId);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Debug($"Not found dynamic method for the tag! {tagName}");
|
_logger.Debug($"Not found dynamic method for the tag! tag: {messageTag};");
|
||||||
|
|
||||||
switch (messageTag)
|
switch (messageTag)
|
||||||
{
|
{
|
||||||
|
|
@ -288,13 +286,13 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_logger.Error($"Server OnReceiveMessage; messageTag not found! {tagName}");
|
_logger.Error($"Server OnReceiveMessage; messageTag not found! messageTag: {messageTag}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Error($"Server OnReceiveMessage; {ex.Message}; {tagName}", ex);
|
_logger.Error($"Server OnReceiveMessage; {ex.Message}", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Error), requestId);
|
await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Error), requestId);
|
||||||
|
|
@ -305,7 +303,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(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; {ConstHelper.NameByValue<SignalRTags>(messageTag)}");
|
_logger.Info($"Server SendMessageToClient; {nameof(messageTag)}: {messageTag}; {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,17 +8,10 @@ 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 : AcSignalRClientBase
|
public class AdminSignalRClient(IEnumerable<IAcLogWriterClientBase> logWriters) : AcSignalRClientBase($"{Setting.BaseUrl}/DevAdminHub", new LoggerClient(nameof(AdminSignalRClient), logWriters.ToArray()));
|
||||||
{
|
|
||||||
public AdminSignalRClient(IEnumerable<IAcLogWriterClientBase> logWriters) : base($"{Setting.BaseUrl}/DevAdminHub", new LoggerClient(nameof(AdminSignalRClient), logWriters.ToArray()))
|
|
||||||
{
|
|
||||||
ConstHelper.NameByValue<SignalRTags>(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue