接口日志

master
rszn 5 months ago
parent 394b18c72e
commit df70f6dd65

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

Loading…
Cancel
Save