rfid读方法优化

master
tq 1 month ago
parent 261d4abaae
commit 7ae8f10265

@ -34,9 +34,13 @@ public class RfidController : ControllerBase
[HttpPost] [HttpPost]
[Route("ReadRfid")] [Route("ReadRfid")]
public async Task<Result<RfidReadModel>> ReadRfid() public async Task<Result<RfidReadModel>> ReadRfid()
{
bool beginRead = await RfidApi.BeginRead();
if (beginRead)
{ {
RfidReadModel? rfidReadModel = await RfidApi.ReadRfid(); RfidReadModel? rfidReadModel = await RfidApi.ReadRfid();
if (rfidReadModel != null) return Result<RfidReadModel>.Success(rfidReadModel, "读取成功"); if (rfidReadModel != null) return Result<RfidReadModel>.Success(rfidReadModel, "读取成功");
}
return Result<RfidReadModel>.Fail(); return Result<RfidReadModel>.Fail();
} }
} }
Loading…
Cancel
Save