|
|
@ -35,8 +35,12 @@ public class RfidController : ControllerBase
|
|
|
|
[Route("ReadRfid")]
|
|
|
|
[Route("ReadRfid")]
|
|
|
|
public async Task<Result<RfidReadModel>> ReadRfid()
|
|
|
|
public async Task<Result<RfidReadModel>> ReadRfid()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
RfidReadModel? rfidReadModel = await RfidApi.ReadRfid();
|
|
|
|
bool beginRead = await RfidApi.BeginRead();
|
|
|
|
if (rfidReadModel != null) return Result<RfidReadModel>.Success(rfidReadModel, "读取成功");
|
|
|
|
if (beginRead)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
RfidReadModel? rfidReadModel = await RfidApi.ReadRfid();
|
|
|
|
|
|
|
|
if (rfidReadModel != null) return Result<RfidReadModel>.Success(rfidReadModel, "读取成功");
|
|
|
|
|
|
|
|
}
|
|
|
|
return Result<RfidReadModel>.Fail();
|
|
|
|
return Result<RfidReadModel>.Fail();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|