Exemple #1
0
 public static IUnionNormalGatewayBuilder AddMsgLogging <TJT808MsgLogging>(this IUnionNormalGatewayBuilder unionNormalGatewayBuilder)
     where TJT808MsgLogging : IUnionMsgLogging
 {
     unionNormalGatewayBuilder.JT808Builder.Services.AddSingleton(typeof(IUnionMsgLogging), typeof(TJT808MsgLogging));
     return(unionNormalGatewayBuilder);
 }
Exemple #2
0
 /// <summary>
 /// 消息流量统计服务(不同的消费者实例)
 /// </summary>
 /// <param name="unionNormalGatewayBuilder"></param>
 /// <returns></returns>
 public static IUnionNormalGatewayBuilder AddTraffic(this IUnionNormalGatewayBuilder unionNormalGatewayBuilder)
 {
     unionNormalGatewayBuilder.JT808Builder.Services.AddSingleton(typeof(IUnionTraffic), typeof(UnionTrafficDefault));
     return(unionNormalGatewayBuilder);
 }
Exemple #3
0
 /// <summary>
 /// 消息流量统计服务(不同的消费者实例)
 /// </summary>
 /// <param name="unionNormalGatewayBuilder"></param>
 /// <returns></returns>
 public static IUnionNormalGatewayBuilder AddTraffic <TIJT808Traffic>(this IUnionNormalGatewayBuilder unionNormalGatewayBuilder)
     where TIJT808Traffic : IUnionTraffic
 {
     unionNormalGatewayBuilder.JT808Builder.Services.AddSingleton(typeof(IUnionTraffic), typeof(TIJT808Traffic));
     return(unionNormalGatewayBuilder);
 }
 /// <summary>
 /// 消息会话通知服务(不同的消费者实例)
 /// </summary>
 /// <typeparam name="TSessionNoticeService">自定义会话通知服务</typeparam>
 /// <param name="unionNormalGatewayBuilder"></param>
 /// <returns></returns>
 public static IUnionNormalGatewayBuilder AddSessionNotice<TSessionNoticeService>(this IUnionNormalGatewayBuilder unionNormalGatewayBuilder)
    where TSessionNoticeService : UnionSessionNoticeService
 {
     unionNormalGatewayBuilder.JT808Builder.Services.AddSingleton<UnionSessionNoticeService, TSessionNoticeService>();
     unionNormalGatewayBuilder.JT808Builder.Services.AddHostedService<UnionSessionNoticeHostedService>();
     return unionNormalGatewayBuilder;
 }
Exemple #5
0
 /// <summary>
 /// 转发服务(不同的消费者实例)
 /// </summary>
 /// <param name="jT808NormalGatewayBuilder"></param>
 /// <param name="configuration"></param>
 /// <returns></returns>
 public static IUnionNormalGatewayBuilder AddTransmit(this IUnionNormalGatewayBuilder jT808NormalGatewayBuilder, IConfiguration configuration)
 {
     jT808NormalGatewayBuilder.JT808Builder.Services.Configure <RemoteServerOptions>(configuration.GetSection("RemoteServerOptions"));
     jT808NormalGatewayBuilder.JT808Builder.Services.AddSingleton <UnionTransmitService>();
     return(jT808NormalGatewayBuilder);
 }
 public static IUnionNormalGatewayBuilder ReplaceNormalReplyMessageHandler <TJT808NormalReplyMessageHandler>(this IUnionNormalGatewayBuilder config)
     where TJT808NormalReplyMessageHandler : UnionNormalReplyMessageHandler
 {
     config.JT808Builder.Services.Replace(new ServiceDescriptor(typeof(UnionNormalReplyMessageHandler), typeof(TJT808NormalReplyMessageHandler), ServiceLifetime.Singleton));
     return(config);
 }