using Entity.Api.Resp;
using Entity.Constant;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Repository.Station;
using Service.Execute;
using Service.Execute.Api;
using Service.Init;
using Service.Plc.Client;
using Service.Station;
namespace WebStarter.Controllers;
///
/// 换电大屏
///
[ApiController]
[Route("api/[controller]")]
public class BinInfoController : ControllerBase
{
private readonly BinInfoRepository _BinInfoRepository;
public BinInfoController(BinInfoRepository infoRepository)
{
_BinInfoRepository = infoRepository;
}
///
/// 启用禁用充电 :
/// id:仓位id
/// flag :1:启用 0:禁用
///
///
///
///
[HttpGet("UpdateCanChargeFlag/{id}/{flag}")]
public async Task> UpdateCanChargeFlag(int id, int flag)
{
BinInfo binInfo = new BinInfo()
{
Id = id,
CanChargeFlag = flag
};
_BinInfoRepository.Update(binInfo);
return Result.Success();
}
///
/// 启用禁用换电 :
/// id:仓位id
/// flag :1:启用 0:禁用
///
///
///
///
[HttpGet("UpdateCanSwapFlag/{id}/{flag}")]
public async Task> UpdateCanSwapFlag(int id, int flag)
{
BinInfo binInfo = new BinInfo()
{
Id = id,
CanSwapFlag = flag
};
_BinInfoRepository.Update(binInfo);
return Result.Success();
}
}