入库单-列表接口

This commit is contained in:
tongfei
2023-10-27 09:30:17 +08:00
parent eec8396a91
commit 8221eae779
8 changed files with 126 additions and 4 deletions

View File

@@ -0,0 +1,46 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WMS.Web.Core.Dto;
using WMS.Web.Core.Internal.Results;
using WMS.Web.Domain.Infrastructure;
using WMS.Web.Domain.IService.Public;
using WMS.Web.Domain.Values;
namespace WMS.Web.Api.Controllers
{
/// <summary>
/// 入库单-接口
/// </summary>
[Route("api/[controller]")]
[ApiController]
public class InStockController : ControllerBase
{
private readonly ILoginService _loginService;
private readonly IInStockRepositories _inStockRepositories;
public InStockController(ILoginService loginService, IInStockRepositories inStockRepositories)
{
this._loginService = loginService;
this._inStockRepositories = inStockRepositories;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
[Route("GetList")]
public async Task<ResultPagedList<InStockQueryResponse>> GetPagedList([FromBody] InStockQueryRequest dto)
{
var loginInfo = _loginService.GetLoginInfo(this.HttpContext.Request.Headers["Authorization"]);
if (loginInfo == null || loginInfo.UserInfo == null)
return ResultPagedList<InStockQueryResponse>.ReFailure(ResultCodes.Token_Invalid_Error);
var result= await _inStockRepositories.GetPagedList(dto);
return result;
}
}
}