diff --git a/Source/Store.Management.Api/Shops/ShopApi.cs b/Source/Store.Management.Api/Shops/ShopApi.cs new file mode 100644 index 0000000..3b8dd42 --- /dev/null +++ b/Source/Store.Management.Api/Shops/ShopApi.cs @@ -0,0 +1,25 @@ +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); + } +} diff --git a/Source/Store.Management.Api/Shops/ShopQueryRequest.cs b/Source/Store.Management.Api/Shops/ShopQueryRequest.cs new file mode 100644 index 0000000..f728804 --- /dev/null +++ b/Source/Store.Management.Api/Shops/ShopQueryRequest.cs @@ -0,0 +1,11 @@ +using Store.Management.Api.Models; + +namespace Store.Management.Api.Shops; + +public sealed class ShopQueryRequest : PageRequest +{ + public string? SearchUserName { get; init; } + public string? SearchId { get; init; } + public string? SearchName { get; init; } + public string? SearchNotes { get; init; } +} diff --git a/Source/Store.Management.Api/StoreApiClient.cs b/Source/Store.Management.Api/StoreApiClient.cs index 0b493b0..58f8dde 100644 --- a/Source/Store.Management.Api/StoreApiClient.cs +++ b/Source/Store.Management.Api/StoreApiClient.cs @@ -11,6 +11,7 @@ public sealed class StoreApiClient : IDisposable public ApiTransport Transport { get; } public AuthApi Auth { get; } public UserApi Users { get; } + public Shops.ShopApi Shops { get; } /// 可选的外部 HTTP 客户端,由调用方管理其生命周期。 public StoreApiClient(ApiClientOptions options, HttpClient? httpClient = null) @@ -22,6 +23,7 @@ public sealed class StoreApiClient : IDisposable Transport = new ApiTransport(options, Session, httpClient); Auth = new AuthApi(Transport, Session); Users = new UserApi(Transport); + Shops = new Shops.ShopApi(Transport); } public void Dispose() diff --git a/Source/Store.Management.Framework/Controls/DataGridEx/DataGridEx.xaml b/Source/Store.Management.Framework/Controls/DataGridEx/DataGridEx.xaml index 7830e8a..74f07e7 100644 --- a/Source/Store.Management.Framework/Controls/DataGridEx/DataGridEx.xaml +++ b/Source/Store.Management.Framework/Controls/DataGridEx/DataGridEx.xaml @@ -176,7 +176,7 @@ - + @@ -203,7 +203,7 @@ - + @@ -334,7 +334,7 @@ - + @@ -370,65 +370,42 @@ + BorderBrush="LightGray" + BorderThickness="1"> - - - - + + + + + - + @@ -1006,7 +983,10 @@ - + + + + + + + + + + + + + Fonts/iconfont.ttf#iconfont + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Store.Management/Views/ShopManagementView.xaml.cs b/Source/Store.Management/Views/ShopManagementView.xaml.cs new file mode 100644 index 0000000..b563d06 --- /dev/null +++ b/Source/Store.Management/Views/ShopManagementView.xaml.cs @@ -0,0 +1,8 @@ +using System.Windows.Controls; + +namespace Store.Management.Views; + +public partial class ShopManagementView : UserControl +{ + public ShopManagementView() => InitializeComponent(); +} diff --git a/Source/Store.Management/Views/UserManagementPage.xaml b/Source/Store.Management/Views/UserManagementPage.xaml index e3a4956..874c2e2 100644 --- a/Source/Store.Management/Views/UserManagementPage.xaml +++ b/Source/Store.Management/Views/UserManagementPage.xaml @@ -47,20 +47,12 @@ - - + + @@ -70,7 +62,6 @@ + Style="{StaticResource TableSearchPrimaryButtonStyle}" />