using System.Threading.Tasks;
using GxPress.Auth;
using GxPress.Common.Page;
using GxPress.Repository.Interface.Order;
using GxPress.Request.Order;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace GxPress.Api.WebControllers
{
///
/// 导航
///
[Route("api/web/order")]
[ApiController]
[Authorize]
public class WebOrderController : Controller
{
private readonly IOrderRepository orderRepository;
public readonly ILoginContext _loginContext;
public WebOrderController(IOrderRepository orderRepository, ILoginContext _loginContext)
{
this.orderRepository = orderRepository;
this._loginContext = _loginContext;
}
///
/// 查询订单
///
///
///
[HttpPost("page")]
public async Task> GetAllOrderAsync(OrderSearchRequest request)
{
request.UserId = _loginContext.AccountId;
return await orderRepository.GetAllOrderAsync(request);
}
}
}