using Autofac; using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Autofac.Attribute; using Service.Init; using Service.System; namespace Service.Cloud.Client; [Scope("SingleInstance")] public class CloudClientMgr { public static CloudClient? CloudClient { get; set; } public static void Init() { SysConfigService sysConfigService = AppInfo.Container.Resolve(); CloudClient = AppInfo.Container.Resolve(); CloudClient.ServerIp = StaticStationInfo.CloudServerIp; CloudClient.ServerPort = StaticStationInfo.CloudServerPort; CloudClient.ClientId = StaticStationInfo.CloudClientId; CloudClient.Username = StaticStationInfo.CloudUsername; CloudClient.Password = StaticStationInfo.CloudPassword; CloudClient.SubTopic = StaticStationInfo.CloudSubTopic; CloudClient.PubTopic = StaticStationInfo.CloudPubTopic; CloudClient.StationNo = StaticStationInfo.StationNo; CloudClient.AutoReConnect = true; CloudClient.InitHandler(); CloudClient.Connect(); } }