using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
///
/// 客户收发货人信息-模块
///
public class ClientShipperController : ApiController
{
private readonly IClientShipperService _invokeService;
///
/// 构造函数
///
///
public ClientShipperController(IClientShipperService invokeService)
{
_invokeService = invokeService;
}
///
/// 列表
///
///
///
[HttpPost]
[Route("GetClientShipperList")]
public DataResult> GetClientShipperList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
///
/// 编辑
///
///
///
[HttpPost]
[Route("EditClientShipper")]
public DataResult EditClientShipper([FromBody] ClientShipperReq req)
{
var res = _invokeService.EditClientShipper(req);
return res;
}
///
/// 详情
///
///
///
[HttpGet]
[Route("GetClientShipperInfo")]
public DataResult GetClientShipperInfo([FromQuery] string id)
{
var res = _invokeService.GetClientShipperInfo(id);
return res;
}
///
/// 根据ID删除
///
///
///
[HttpPost, Route("Delete")]
public async Task DeleteAsync([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _invokeService.DeleteAsync(model);
}
}