2017-05-04 13:01:14 +02:00
|
|
|
|
namespace WebMVC.Infrastructure
|
|
|
|
|
{
|
|
|
|
|
public static class API
|
|
|
|
|
{
|
|
|
|
|
public static class Basket
|
|
|
|
|
{
|
|
|
|
|
public static string GetBasket(string baseUri, string basketId)
|
|
|
|
|
{
|
|
|
|
|
return $"{baseUri}/{basketId}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string UpdateBasket(string baseUri)
|
|
|
|
|
{
|
|
|
|
|
return baseUri;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-11 11:51:13 +02:00
|
|
|
|
public static string CheckoutBasket(string baseUri)
|
|
|
|
|
{
|
|
|
|
|
return $"{baseUri}/checkout";
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-04 13:01:14 +02:00
|
|
|
|
public static string CleanBasket(string baseUri, string basketId)
|
|
|
|
|
{
|
|
|
|
|
return $"{baseUri}/{basketId}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class Order
|
|
|
|
|
{
|
|
|
|
|
public static string GetOrder(string baseUri, string orderId)
|
|
|
|
|
{
|
|
|
|
|
return $"{baseUri}/{orderId}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetAllMyOrders(string baseUri)
|
|
|
|
|
{
|
|
|
|
|
return baseUri;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string AddNewOrder(string baseUri)
|
|
|
|
|
{
|
|
|
|
|
return $"{baseUri}/new";
|
|
|
|
|
}
|
2017-05-11 11:51:13 +02:00
|
|
|
|
|
|
|
|
|
public static string CancelOrder(string baseUri)
|
|
|
|
|
{
|
|
|
|
|
return $"{baseUri}/cancel";
|
|
|
|
|
}
|
2017-05-14 14:48:37 +02:00
|
|
|
|
|
|
|
|
|
public static string ShipOrder(string baseUri)
|
|
|
|
|
{
|
|
|
|
|
return $"{baseUri}/ship";
|
|
|
|
|
}
|
2017-05-04 13:01:14 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class Catalog
|
|
|
|
|
{
|
|
|
|
|
public static string GetAllCatalogItems(string baseUri, int page, int take, int? brand, int? type)
|
|
|
|
|
{
|
|
|
|
|
var filterQs = "";
|
|
|
|
|
|
|
|
|
|
if (brand.HasValue || type.HasValue)
|
|
|
|
|
{
|
|
|
|
|
var brandQs = (brand.HasValue) ? brand.Value.ToString() : "null";
|
|
|
|
|
var typeQs = (type.HasValue) ? type.Value.ToString() : "null";
|
|
|
|
|
filterQs = $"/type/{typeQs}/brand/{brandQs}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $"{baseUri}items{filterQs}?pageIndex={page}&pageSize={take}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetAllBrands(string baseUri)
|
|
|
|
|
{
|
|
|
|
|
return $"{baseUri}catalogBrands";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string GetAllTypes(string baseUri)
|
|
|
|
|
{
|
|
|
|
|
return $"{baseUri}catalogTypes";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|