using Microsoft.AspNetCore.Mvc;
|
using Rhea.Common;
|
using System.Collections.Generic;
|
using System.Threading.Tasks;
|
using Tiger.IBusiness;
|
using Tiger.Model;
|
|
namespace Tiger.Api.Controllers.WMS
|
{
|
public partial class WMSController : ControllerBase
|
{
|
|
/// <summary>
|
/// 获取分页
|
/// </summary>
|
/// <param name="action"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/[action]")]
|
public async Task<IActionResult> GetModelInfo([FromBody] ApiAction<PageAble<ModelInfo>> action)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(await DI.Resolve<IModelInfo>().GetModelInfo(action.Data));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 导入
|
/// </summary>
|
/// <param name="action"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/[action]")]
|
public async Task<IActionResult> SaveImportModelInfo([FromBody] ApiAction<List<ModelInfo>> action)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(await DI.Resolve<IModelInfo>().SaveImportModelInfo(action.Data));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
|
/// <summary>
|
/// 保存
|
/// </summary>
|
/// <param name="action"></param>
|
/// <returns></returns>
|
[HttpPost]
|
[Route("api/[controller]/[action]")]
|
public async Task<IActionResult> SaveModelInfo([FromBody] ApiAction<ModelInfo> action)
|
{
|
ApiAction response = new();
|
try
|
{
|
response = response.GetResponse(await DI.Resolve<IModelInfo>().SaveModel(action.Data));
|
}
|
catch (System.Exception ex)
|
{
|
response = response.GetResponse().CatchExceptionWithLog(ex);
|
}
|
return Ok(response);
|
}
|
}
|
}
|