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

84 lines
3.3 KiB

using BBWYB.Client.Models;
using BBWYB.Common.Http;
using BBWYB.Common.Models;
using System;
2 years ago
using System.Collections.Generic;
using System.Linq;
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,
2 years ago
string purchaseOrderId,
string sourceShopName,
string sourceSku,
int pageIndex,
int pageSize,
long? shopId,
bool excludeCanceled)
{
2 years ago
return SendRequest<OrderListResponse>(globalContext.BBWYApiHost, "api/order/getorderlist", new
{
2 years ago
orderId,
shopId,
startDate,
endDate,
orderState,
pageIndex,
pageSize,
productId,
Sku = skuId,
2 years ago
clientOrderId,
purchaseOrderId,
sourceShopName,
sourceSku
}, null, HttpMethod.Post);
}
2 years ago
public ApiResponse<object> CancelOrder(string orderId, string remark)
{
2 years ago
return SendRequest<object>(globalContext.BBWYApiHost, "api/order/CancelOrder", new
2 years ago
{
orderId,
remark,
globalContext.User.Shop.AppKey,
globalContext.User.Shop.AppSecret,
globalContext.User.Shop.AppToken,
globalContext.User.Shop.Platform
}, null, HttpMethod.Post);
}
2 years ago
public ApiResponse<object> EditPrice(string orderId, IList<OrderSkuEditPrice> orderSkuList)
{
return SendRequest<object>(globalContext.BBWYApiHost, "api/order/EditPrice", new
{
orderId,
EditItems = orderSkuList.Select(osku => new
{
OrderSkuId = osku.Id,
SkuId = osku.SkuId,
Price = osku.NewPrice,
Freight = osku.FreightAmount,
Quantity = osku.ItemTotal
}),
globalContext.User.Shop.AppKey,
globalContext.User.Shop.AppSecret,
globalContext.User.Shop.AppToken,
globalContext.User.Shop.Platform
}, null, HttpMethod.Post);
}
}
}