using DotNetty.Transport.Channels;
using HybirdFrameworkCore.Autofac.Attribute;
using log4net;
using Service.Fire.Client;
using Service.Fire.Common;
using Service.Fire.Msg.Fire.Req;
namespace Service.Fire.Handler;
///
/// 发送事件
///
/// 1,保存日志到log
///
///
[Order(8)]
[Scope("InstancePerDependency")]
public class DataNoAddresReqHandler : SimpleChannelInboundHandler, IBaseHandler
{
private static readonly ILog Log = LogManager.GetLogger(typeof(DataNoAddresReqHandler));
protected override void ChannelRead0(IChannelHandlerContext ctx, DataNoAddresReq msg)
{
if (FireMgr.TryGetClient(ctx.Channel, out var sn, out var client))
{
Log.Info($"receive {msg} from {sn}");
string datatime = (new DateTime(2000 + msg.Years, msg.Month, msg.Day, msg.Hour, msg.Minute, msg.Seconds)).ToString();
string functionalAttribute = FireConst.FunctionalAttribute(msg.FunctionalAttribute);
string informationType = FireConst.InformationType(msg.InformationType);
string deviceStatus = FireConst.DeviceStatus(msg.DeviceStatus);
string deviceType = FireConst.DeviceType(msg.DeviceType);
}
}
}