using RestSharp;
using Store.Management.Api.Models;
using Store.Management.Api.Transport;
using Store.Management.Models;
namespace Store.Management.Api.Shops;
public sealed class ShopApi(ApiTransport transport)
{
/// 按店铺 ID 获取 Cookie,仅在用户请求时读取。
public Task> GetCookiesAsync(string shopId, CancellationToken cancellationToken = default)
{
ArgumentException.ThrowIfNullOrWhiteSpace(shopId);
return transport.GetRequiredAsync>("shop/GetShopCookies", Method.Post,
new { ShopIds = new[] { shopId } }, cancellationToken: cancellationToken);
}
/// 管理员分页查询商铺,筛选条件由服务端处理。
public Task> SearchAsync(ShopQueryRequest request, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(request);
return transport.GetRequiredAsync>("shop/GetAllShops", Method.Post,
request, cancellationToken: cancellationToken);
}
}