|
|
|
|
using HybirdFrameworkCore.Autofac.Attribute;
|
|
|
|
|
using HybirdFrameworkDriver.Common;
|
|
|
|
|
using HybirdFrameworkDriver.TcpServer;
|
|
|
|
|
using Service.Car.Codec;
|
|
|
|
|
using Service.Car.Handler;
|
|
|
|
|
using Service.Car.Msg.Car.Resp;
|
|
|
|
|
using Service.Car.Msg.Host.Req;
|
|
|
|
|
|
|
|
|
|
namespace Service.Car.Server;
|
|
|
|
|
|
|
|
|
|
[Scope("SingleInstance")]
|
|
|
|
|
public class CarServer : TcpServer<IBaseHandler, Decoder, Encoder>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public MsgPair<LockMsg, LockMsgResp> LockMsgPair { get; set; } = new ();
|
|
|
|
|
|
|
|
|
|
public MsgPair<UnLockMsg, UnLockMsgResp> UnLockMsgPair { get; set; } = new ();
|
|
|
|
|
|
|
|
|
|
public MsgPair<SetParamMsg, SetParamMsgResp> SetParamMsgPair { get; set; } = new ();
|
|
|
|
|
|
|
|
|
|
public MsgPair<SettleConfirmMsg, SettleConfirmMsgResp> SettleConfirmMsgPair { get; set; } = new ();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 1 待机 2 换电
|
|
|
|
|
/// </summary>
|
|
|
|
|
public byte StationStatus { get; set; } = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CarServer() : base()
|
|
|
|
|
{
|
|
|
|
|
this.ChannelInActiveAction = Clean;
|
|
|
|
|
this.LogLevel = DotNetty.Handlers.Logging.LogLevel.INFO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 清理数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void Clean()
|
|
|
|
|
{
|
|
|
|
|
LockMsgPair.ClearResp();
|
|
|
|
|
UnLockMsgPair.ClearResp();
|
|
|
|
|
SetParamMsgPair.ClearResp();
|
|
|
|
|
SettleConfirmMsgPair.ClearResp();
|
|
|
|
|
}
|
|
|
|
|
}
|