using AyCode.Core.Extensions;
using AyCode.Core.Loggers;
using AyCode.Core.Serializers.Binaries;
using AyCode.Core.Serializers.Jsons;
using AyCode.Models.Server.DynamicMethods;
using AyCode.Services.SignalRs;
using FruitBank.Common.Interfaces;
using FruitBank.Common.Loggers;
using FruitBank.Common.Server.Interfaces;
using FruitBank.Common.SignalRs;
using Mango.Nop.Core.Loggers;
using Microsoft.Extensions.Configuration;

namespace FruitBank.Common.Server.Services.SignalRs;

public class DevAdminSignalRHub : AcWebSignalRHubWithSessionBase<SignalRTags, Logger<DevAdminSignalRHub>>
{
    public DevAdminSignalRHub(IConfiguration configuration, IFruitBankDataControllerServer fruitBankDataController/*, SessionService sessionService*/, 
        ICustomOrderSignalREndpointServer customOrderSignalREndpoint, IStockSignalREndpointServer stockSignalREndpointServer, IEnumerable<IAcLogWriterBase> logWriters)
        : base(configuration, new Logger<DevAdminSignalRHub>(logWriters.ToArray()))
    {
        EnableBinaryDiagnostics = FruitBankConstClient.SignalRSerializerDiagnosticLog;
        SerializerOptions = new AcBinarySerializerOptions();

        // Use the new lazy Registry - no reflection at construction time
        DynamicMethodRegistry.CahcheSizeCapacity = 3;

        DynamicMethodRegistry.Register(fruitBankDataController);
        DynamicMethodRegistry.Register(customOrderSignalREndpoint);
        DynamicMethodRegistry.Register(stockSignalREndpointServer);
    }

    protected override void LogContextUserNameAndId()
    {
        return;
        base.LogContextUserNameAndId();
    }
    // ...existing commented code...
}