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.

62 lines
1.6 KiB

6 months ago
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;
/// <summary>
/// 电池移仓
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class MoveBinRecordController
{
private readonly MonitorService _monitorService;
public MoveBinRecordController(MonitorService monitorService)
{
_monitorService = monitorService;
}
[HttpPost]
[Route("page")]
public async Task<Result<PageResult<MoveBinRecord>>> page([FromBody] PageMoveBinRecordReq input)
{
return Result<PageResult<MoveBinRecord>>.Success(await _monitorService.Page(input));
}
[HttpPost]
[Route("add")]
public async Task<Result<string>> Add([FromBody] AddMoveBinRecordReq input)
{
var data = await _monitorService.Add(input);
return Result<string>.Success(data);
}
[HttpPost]
[Route("update")]
public async Task<Result<bool>> Update([FromBody] UpdateMoveBinRecordReq req)
{
var data = await _monitorService.Update(req);
if (data)
return Result<bool>.Success(data);
else
return Result<bool>.Fail(data);
}
[HttpPost]
[Route("delete")]
public async Task<Result<bool>> Delete([FromBody] [Required] DeleteMoveBinRecordReq input)
{
var data = await _monitorService.Delete(input);
if (data)
return Result<bool>.Success(data);
else
return Result<bool>.Fail(data);
}
}