using HybirdFrameworkCore.Autofac.Attribute; using Newtonsoft.Json; using Service.Cloud.Client; using Service.Cloud.Common; using Service.Cloud.Msg.Cloud.Req; using Service.Cloud.Msg.Host.Resp; namespace Service.Cloud.Handler; [Scope("InstancePerDependency")] public class CarCanStartHandler : IBaseHandler { public bool CanHandle(string cmd) { return CloudConst.carCanStart == cmd; } public void Handle(string t) { CarCanStart? carCanStart = JsonConvert.DeserializeObject(t); CloudClientMgr.CloudClient.CarCanStart = carCanStart; if (carCanStart!=null) { CarCanStartRes resp = new CarCanStartRes(0,carCanStart.channel,carCanStart.order,1); CloudClientMgr.CloudClient?.Publish(resp); } } }