You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
962 B

5 months ago
using System.Text;
using Common.Util;
using HybirdFrameworkCore.Autofac.Attribute;
using Newtonsoft.Json;
using Service.Cloud.Client;
5 months ago
using Service.Cloud.Common;
5 months ago
using Service.Cloud.Msg.Cloud.Req.OutCharger.Req;
using Service.Cloud.Msg.Cloud.Resp.OutCharger;
5 months ago
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<PileStopCharge>(t);
if (pileStopCharge != null)
{
5 months ago
HttpUtil.SendPostRequest(pileStopCharge, "http://127.0.0.1:5035/api/OutCharger/SendStopOutCharger");
5 months ago
}
PileRealtimeResp res = new()
{
rs="1",
pn=pileStopCharge.pn,
};
CloudClientMgr.CloudClient?.Publish(res);
5 months ago
}
}