using System.Text; using Common.Util; using HybirdFrameworkCore.Autofac.Attribute; using Newtonsoft.Json; using Service.Cloud.Client; using Service.Cloud.Common; using Service.Cloud.Msg.Cloud.Req.OutCharger.Req; using Service.Cloud.Msg.Cloud.Resp.OutCharger; namespace Service.Cloud.Handler.OutCharger; [Scope("InstancePerDependency")] public class PileStopChargeHandler : IBaseHandler { public bool CanHandle(string cmd) { return CloudConst.pileStopCharge == cmd; } public void Handle(string t) { PileStopCharge? pileStopCharge = JsonConvert.DeserializeObject(t); if (pileStopCharge != null) { HttpUtil.SendPostRequest(pileStopCharge, "http://127.0.0.1:5035/api/OutCharger/SendStopOutCharger"); } PileRealtimeResp res = new() { rs="1", pn=pileStopCharge.pn, }; CloudClientMgr.CloudClient?.Publish(res); } }