23 lines
967 B
C#
23 lines
967 B
C#
using MAX.Core.DependencyInjection;
|
|
using Store.Management.Api;
|
|
using Store.Management.Api.Models;
|
|
using Store.Management.Api.Shops;
|
|
using Store.Management.Models;
|
|
|
|
namespace Store.Management.Framework.Services;
|
|
|
|
public interface IShopService
|
|
{
|
|
Task<IReadOnlyList<ShopCookieInfo>> GetCookiesAsync(string shopId, CancellationToken cancellationToken = default);
|
|
Task<PageResult<ShopInfo>> SearchAsync(ShopQueryRequest request, CancellationToken cancellationToken = default);
|
|
}
|
|
|
|
internal sealed class ShopService(StoreApiClient client) : IShopService, ISingletonDependency
|
|
{
|
|
public Task<IReadOnlyList<ShopCookieInfo>> GetCookiesAsync(string shopId, CancellationToken cancellationToken = default)
|
|
=> client.Shops.GetCookiesAsync(shopId, cancellationToken);
|
|
|
|
public Task<PageResult<ShopInfo>> SearchAsync(ShopQueryRequest request, CancellationToken cancellationToken = default)
|
|
=> client.Shops.SearchAsync(request, cancellationToken);
|
|
}
|