You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

7 months ago
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.Charger;
namespace WebStarter.Controllers;
/// <summary>
/// 充电机管理
/// </summary>
[Produces("application/json")]
[ApiController]
[Route("/api[controller]")]
public class ChargeController : ControllerBase
{
private ChargerService _chargerService;
public ChargeController(ChargerService chargerService)
{
_chargerService = chargerService;
}
/// <summary>
/// 通过仓号启动充电
/// </summary>
/// <param name="binNo">仓号</param>
/// <returns></returns>
[HttpGet]
[Route("/StartChargeByBinNo/{binNo}")]
public Result<bool> StartChargeByBinNo(string binNo)
{
return _chargerService.StartChargeByBinNo(binNo);
}
/// <summary>
/// 通过仓号停止充电
/// </summary>
/// <param name="binNo">仓号</param>
/// <returns></returns>
[HttpGet]
[Route("/StopChargeByBinNo/{binNo}")]
public Result<bool> StopChargeByBinNo(string binNo)
{
return _chargerService.StartChargeByBinNo(binNo);
}
}