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.

37 lines
1.2 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)
.OrderByDescending(x => x.Id)
.Select<OrderHistoryDto>()
.ToListAsync();
return Success(result);
}
}
}