using Entity.Api.Req; using HybirdFrameworkCore.Entity; using Microsoft.AspNetCore.Mvc; using Service.Charger.Client; using Service.Execute.Api; using Service.Execute.Model; namespace WebStarter.Controllers; /// /// rfid读取 /// [ApiController] [Route("api/[controller]")] public class RfidController : ControllerBase { /// /// rfid写 /// /// [HttpPost] [Route("BeginWrite")] public async Task> BeginWrite([FromBody] RfidWriteReq req) { await RfidApi.BeginWriteAsync(req.VehicleNo,req.VehicleVin); return Result.Success(true, "发送成功"); } /// /// 读rfid /// /// [HttpPost] [Route("ReadRfid")] public async Task> ReadRfid() { bool beginRead = await RfidApi.BeginRead(); if (beginRead) { RfidReadModel? rfidReadModel = await RfidApi.ReadRfid(); if (rfidReadModel != null) return Result.Success(rfidReadModel, "读取成功"); } return Result.Fail(); } }