using System.Dynamic;
using MES.Service.service.BasicData;
using MES.Service.util;
using Microsoft.AspNetCore.Mvc;
namespace MESApplication.Controllers.BasicData;
///
/// Simple控制器 - 菜单树形结构
///
[ApiController]
[Route("api/[controller]")]
public class MesSimpleController : ControllerBase
{
private readonly MesSimpleManager _manager = new();
///
/// 获取树形结构数据
///
/// 树形结构数据
[HttpPost("GetTree")]
public ResponseResult GetTree()
{
try
{
dynamic resultInfos = new ExpandoObject();
resultInfos.tbBillList = _manager.GetTree();
return new ResponseResult
{
status = 0,
message = "OK",
data = resultInfos
};
}
catch (Exception ex)
{
return ResponseResult.ResponseError(ex);
}
}
///
/// 获取树形结构数据(新表 MES_SIMPLE_NEW)
///
/// 树形结构数据
[HttpPost("GetTreeNew")]
public ResponseResult GetTreeNew()
{
try
{
dynamic resultInfos = new ExpandoObject();
resultInfos.tbBillList = _manager.GetTreeNew();
return new ResponseResult
{
status = 0,
message = "OK",
data = resultInfos
};
}
catch (Exception ex)
{
return ResponseResult.ResponseError(ex);
}
}
}