This commit is contained in:
Loretta 2024-07-18 19:21:19 +02:00
parent 63b02a4a93
commit e1f9e1748d
3 changed files with 18 additions and 3 deletions

View File

@ -1,6 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using AyCode.Interfaces.TimeStampInfo;
using Newtonsoft.Json;
using TIAM.Core.Enums;
using TIAM.Entities.Profiles;
@ -23,6 +24,10 @@ public abstract class ProductBase : IProductBase, ITimeStampInfo
public string Name { get; set; }
public string Description { get; set; }
public float Price { get; set; }
[NotMapped]
[JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string? JsonDetails { get; set; }
public DateTime Created { get; set; }

View File

@ -2,6 +2,7 @@
using System.ComponentModel.DataAnnotations.Schema;
using AyCode.Interfaces.Entities;
using AyCode.Interfaces.TimeStampInfo;
using Newtonsoft.Json;
using TIAM.Entities.Drivers;
using TIAM.Entities.Products;
@ -27,6 +28,8 @@ public class UserProductMapping : IEntityGuid, IUserRelation, IProductRelation,
//[Column("JsonDetailModel")]
[NotMapped]
[JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public UserProductJsonDetailModel? JsonDetailModel { get; set; } = null;
public DateTime Created { get; set; }

View File

@ -215,7 +215,13 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
}
else _logger.Debug($"{logText}(); {tagName}");
await ResponseToCaller(messageTag, new SignalResponseJsonMessage(messageTag, SignalResponseStatus.Success, methodInfoModel.MethodInfo.InvokeMethod(methodsByDeclaringObject.InstanceObject, paramValues)), requestId);
var responseDataJson = new SignalResponseJsonMessage(messageTag, SignalResponseStatus.Success, methodInfoModel.MethodInfo.InvokeMethod(methodsByDeclaringObject.InstanceObject, paramValues));
var responseDataJsonKiloBytes = System.Text.Encoding.Unicode.GetByteCount(responseDataJson.ResponseData!) / 1024;
//File.WriteAllText(Path.Combine("h:", $"{requestId}.json"), responseDataJson.ResponseData);
_logger.Info($"[{responseDataJsonKiloBytes}kb] responseData serialized to json");
await ResponseToCaller(messageTag, responseDataJson, requestId);
return;
}
@ -309,9 +315,10 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
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)}");
var responseDataMessagePack = message.ToMessagePack(ContractlessStandardResolver.Options);
_logger.Info($"[{(responseDataMessagePack.Length/1024)}kb] Server sending responseDataMessagePack to client; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; {ConstHelper.NameByValue<SignalRTags>(messageTag)}");
await sendTo.OnReceiveMessage(messageTag, message.ToMessagePack(ContractlessStandardResolver.Options), requestId);
await sendTo.OnReceiveMessage(messageTag, responseDataMessagePack, requestId);
}
public async Task SendMessageToGroup(string groupId, int messageTag, string message)