You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB
C#

using EntrustSettle.Controllers;
using EntrustSettle.IServices;
using EntrustSettle.Model;
using EntrustSettle.Model.Dtos;
using Microsoft.AspNetCore.Mvc;
namespace EntrustSettle.Api.Controllers
{
/// <summary>
/// 订单状态历史
/// </summary>
public class OrderHistoryController : BaseApiController
{
private readonly IOrderHistoryService orderHistoryService;
public OrderHistoryController(IOrderHistoryService orderHistoryService)
{
this.orderHistoryService = orderHistoryService;
}
/// <summary>
/// 获取订单状态历史列表
/// </summary>
/// <param name="orderId">订单Id</param>
[HttpGet]
public async Task<MessageModel<List<OrderHistoryDto>>> GetOrderHistoryList(long orderId)
{
var result = await orderHistoryService.AsQueryable()
.Where(x => x.Pid == orderId)
.Select<OrderHistoryDto>()
.ToListAsync();
return Success(result);
}
}
}