using System.Dynamic;
using Microsoft.AspNetCore.Mvc;
using PadApplication.Entites.DbModels;
using PadApplication.Entites.Dto;
using PadApplication.Services;
using PadApplication.util;
namespace PadApplication.Controllers;
///
/// 刀具台账控制器,提供刀具相关的接口
///
[ApiController]
[Route("api/[controller]")]
public class MesCutterLedgerController : ControllerBase
{
private readonly MesCutterLedgerManager m = new();
///
/// 刀具查询(支持编号或名称模糊查询)MesCutterLedger
///
/// 查询关键字请求体
/// 刀具列表
[HttpPost("QueryTools")]
public ResponseResult QueryTools([FromBody] MesCutterLedger req)
{
try
{
dynamic resultInfos = new ExpandoObject();
resultInfos.tbBillList = m.QueryTools(req.searchKey);
return new ResponseResult
{
status = 0,
message = "OK",
data = resultInfos
};
}
catch (Exception ex)
{
return ResponseResult.ResponseError(ex);
}
}
}