接口日志

master
rszn 5 months ago
parent 394b18c72e
commit df70f6dd65

@ -22,7 +22,7 @@ public class TBoxController : ControllerBase
[HttpGet("/connect/{carNo}")]
public bool Connect(string carNo)
{
Log.Info($"Connect-{carNo}");
Log.Info($"Connect {carNo}");
TBoxServerMgr.Server.StartSendVin(carNo);
return TBoxServerMgr.Server != null && TBoxServerMgr.Server.Connected;
}
@ -35,7 +35,7 @@ public class TBoxController : ControllerBase
[HttpGet("/lock/{carNo}")]
public int Lock(string carNo)
{
Log.Info($"Lock");
Log.Info($"Lock {carNo}");
TBoxServerMgr.Server?.StartSendLock(1);
return TBoxServerMgr.Server?.LockStatusMsg?.LockStatus ?? 100;
}
@ -58,9 +58,9 @@ public class TBoxController : ControllerBase
/// </summary>
/// <returns></returns>
[HttpGet("/getCarInfo/{carNo}")]
public TBoxInfo GetCarInfo()
public TBoxInfo GetCarInfo(string carNo)
{
Log.Info($"Restart");
Log.Info($"DisConnect {carNo}");
TBoxInfo result = new TBoxInfo()
{
BatteryOneSn = TBoxServerMgr.Server?.BatteryOneSn,
@ -92,8 +92,9 @@ public class TBoxController : ControllerBase
[HttpGet("/disConnect/{carNo}")]
public bool DisConnect(string carNo)
{
Log.Info($"DisConnect {carNo}");
TBoxServerMgr.Server?.StartSendLock(0);
return true;
return TBoxServerMgr.Server != null && !TBoxServerMgr.Server.Connected;
}
/// <summary>
@ -104,6 +105,7 @@ public class TBoxController : ControllerBase
[HttpGet("/reset")]
public bool Reset()
{
Log.Info($"Reset ");
TBoxServerMgr.Server?.Reset();
return true;
}

Loading…
Cancel
Save