using HybirdFrameworkCore.Autofac.Attribute; using Service.UpsAfrica.Msg; using HybirdFrameworkCore.Autofac; using Autofac; namespace Service.UpsAfrica.Client; [Scope] public class UpsAfricaMgr { public static UpsAfricaClient? UpsAfricaClient; public static readonly UpsIndex30 UpsIndex30 = new UpsIndex30(); public static readonly UpsIndex40 UpsIndex40 = new UpsIndex40(); public static readonly UpsIndex50 UpsIndex50 = new UpsIndex50(); public static readonly UpsIndex60 UpsIndex60 = new UpsIndex60(); public static readonly UpsIndexA0 UpsIndexA0 = new UpsIndexA0(); public static readonly UpsIndexC0 UpsIndexC0 = new UpsIndexC0(); /// /// 数据有效时间。单位秒 /// static int DataTimeSeconds = 20; /// /// 数据刷新时间 /// public static DateTime DataValidityTime = DateTime.Now; public static void UpsInit() { if (UpsAfricaClient == null) { UpsAfricaClient = AppInfo.Container.Resolve(); } Task.Run(() => UpsAfricaClient.Connect()); } }