using System.ComponentModel.DataAnnotations;
using Entity.DbModel.Station;
using Entity.Dto.Req;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.Station;
namespace WebStarter.Controllers;
///
/// 电池移仓
///
[ApiController]
[Route("api/[controller]")]
public class MoveBinRecordController
{
private readonly MonitorService _monitorService;
public MoveBinRecordController(MonitorService monitorService)
{
_monitorService = monitorService;
}
[HttpPost]
[Route("page")]
public async Task>> page([FromBody] PageMoveBinRecordReq input)
{
return Result>.Success(await _monitorService.Page(input));
}
[HttpPost]
[Route("add")]
public async Task> Add([FromBody] AddMoveBinRecordReq input)
{
var data = await _monitorService.Add(input);
return Result.Success(data);
}
[HttpPost]
[Route("update")]
public async Task> Update([FromBody] UpdateMoveBinRecordReq req)
{
var data = await _monitorService.Update(req);
if (data)
return Result.Success(data);
else
return Result.Fail(data);
}
[HttpPost]
[Route("delete")]
public async Task> Delete([FromBody] [Required] DeleteMoveBinRecordReq input)
{
var data = await _monitorService.Delete(input);
if (data)
return Result.Success(data);
else
return Result.Fail(data);
}
}