|
|
|
using BBWYB.Client.Models;
|
|
|
|
using BBWYB.Common.Http;
|
|
|
|
using BBWYB.Common.Models;
|
|
|
|
using System;
|
|
|
|
using System.Net.Http;
|
|
|
|
|
|
|
|
namespace BBWYB.Client.APIServices
|
|
|
|
{
|
|
|
|
public class OrderService : BaseApiService, IDenpendency
|
|
|
|
{
|
|
|
|
public OrderService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public ApiResponse<OrderListResponse> GetOrderList(string orderId,
|
|
|
|
DateTime startDate,
|
|
|
|
DateTime endDate,
|
|
|
|
OrderState? orderState,
|
|
|
|
string productId,
|
|
|
|
string skuId,
|
|
|
|
string clientOrderId,
|
|
|
|
string purchaseOrderId,
|
|
|
|
string sourceShopName,
|
|
|
|
string sourceSku,
|
|
|
|
int pageIndex,
|
|
|
|
int pageSize,
|
|
|
|
long? shopId,
|
|
|
|
bool excludeCanceled)
|
|
|
|
{
|
|
|
|
return SendRequest<OrderListResponse>(globalContext.BBYWApiHost, "api/order/getorderlist", new
|
|
|
|
{
|
|
|
|
orderId,
|
|
|
|
shopId,
|
|
|
|
startDate,
|
|
|
|
endDate,
|
|
|
|
orderState,
|
|
|
|
pageIndex,
|
|
|
|
pageSize,
|
|
|
|
productId,
|
|
|
|
Sku = skuId,
|
|
|
|
clientOrderId,
|
|
|
|
purchaseOrderId,
|
|
|
|
sourceShopName,
|
|
|
|
sourceSku
|
|
|
|
}, null, HttpMethod.Post);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ApiResponse<object> CancelOrder(string orderId, string remark)
|
|
|
|
{
|
|
|
|
return SendRequest<object>(globalContext.BBYWApiHost, "api/order/CancelOrder", new
|
|
|
|
{
|
|
|
|
orderId,
|
|
|
|
remark,
|
|
|
|
globalContext.User.Shop.AppKey,
|
|
|
|
globalContext.User.Shop.AppSecret,
|
|
|
|
globalContext.User.Shop.AppToken,
|
|
|
|
globalContext.User.Shop.Platform
|
|
|
|
}, null, HttpMethod.Post);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|