diff --git a/.editorconfig b/.editorconfig index 32193b8..6c8b717 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,3 +4,10 @@ root = true [*.cs] dotnet_diagnostic.SA1600.severity = error dotnet_diagnostic.SA1601.severity = error +dotnet_diagnostic.SA1615.severity = error +dotnet_diagnostic.SA1629.severity = none +dotnet_diagnostic.SA1202.severity = none +dotnet_diagnostic.SA1200.severity = none +dotnet_diagnostic.SA1623.severity = none +dotnet_diagnostic.SA1111.severity = none +dotnet_diagnostic.SA1101.severity = none diff --git a/Directory.Build.props b/Directory.Build.props index f83743e..6f0ab73 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,5 +9,8 @@ + + + diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/AuthController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/AuthController.cs index b38d018..32b4e5a 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/AuthController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/AuthController.cs @@ -1,8 +1,4 @@ -using System; -using System.Threading; -using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.Identity.Abstractions; using TakeoutSaaS.Application.Identity.Contracts; @@ -26,6 +22,9 @@ public sealed class AuthController(IAdminAuthService authService) : BaseApiContr /// /// 登录获取 Token /// + /// 登录请求。 + /// 取消标记。 + /// 包含访问令牌与刷新令牌的响应。 [HttpPost("login")] [AllowAnonymous] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -38,6 +37,9 @@ public sealed class AuthController(IAdminAuthService authService) : BaseApiContr /// /// 刷新 Token /// + /// 刷新令牌请求。 + /// 取消标记。 + /// 新的访问令牌与刷新令牌。 [HttpPost("refresh")] [AllowAnonymous] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -73,6 +75,8 @@ public sealed class AuthController(IAdminAuthService authService) : BaseApiContr /// } /// /// + /// 取消标记。 + /// 当前用户档案信息。 [HttpGet("profile")] [PermissionAuthorize("identity:profile:read")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -116,6 +120,9 @@ public sealed class AuthController(IAdminAuthService authService) : BaseApiContr /// } /// /// + /// 目标用户 ID。 + /// 取消标记。 + /// 用户权限概览,未找到则返回 404。 [HttpGet("permissions/{userId:long}")] [PermissionAuthorize("identity:permission:read")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/DeliveriesController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/DeliveriesController.cs index ae7c092..6f0f953 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/DeliveriesController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/DeliveriesController.cs @@ -1,6 +1,5 @@ using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.App.Deliveries.Commands; using TakeoutSaaS.Application.App.Deliveries.Dto; @@ -24,6 +23,9 @@ public sealed class DeliveriesController(IMediator mediator) : BaseApiController /// /// 创建配送单。 /// + /// 创建命令。 + /// 取消标记。 + /// 创建后的配送单。 [HttpPost] [PermissionAuthorize("delivery:create")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -39,6 +41,14 @@ public sealed class DeliveriesController(IMediator mediator) : BaseApiController /// /// 查询配送单列表。 /// + /// 订单 ID。 + /// 配送状态。 + /// 页码。 + /// 每页大小。 + /// 排序字段。 + /// 是否倒序。 + /// 取消标记。 + /// 配送单分页列表。 [HttpGet] [PermissionAuthorize("delivery:read")] [ProducesResponseType(typeof(ApiResponse>), StatusCodes.Status200OK)] @@ -69,6 +79,9 @@ public sealed class DeliveriesController(IMediator mediator) : BaseApiController /// /// 获取配送单详情。 /// + /// 配送单 ID。 + /// 取消标记。 + /// 配送单详情或未找到。 [HttpGet("{deliveryOrderId:long}")] [PermissionAuthorize("delivery:read")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -87,6 +100,10 @@ public sealed class DeliveriesController(IMediator mediator) : BaseApiController /// /// 更新配送单。 /// + /// 配送单 ID。 + /// 更新命令。 + /// 取消标记。 + /// 更新后的配送单或未找到。 [HttpPut("{deliveryOrderId:long}")] [PermissionAuthorize("delivery:update")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -111,6 +128,9 @@ public sealed class DeliveriesController(IMediator mediator) : BaseApiController /// /// 删除配送单。 /// + /// 配送单 ID。 + /// 取消标记。 + /// 删除结果,未找到则返回错误。 [HttpDelete("{deliveryOrderId:long}")] [PermissionAuthorize("delivery:delete")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/DictionaryController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/DictionaryController.cs index 28e0d61..f2cc347 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/DictionaryController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/DictionaryController.cs @@ -21,6 +21,9 @@ public sealed class DictionaryController(IDictionaryAppService dictionaryAppServ /// /// 查询字典分组。 /// + /// 分组查询条件。 + /// 取消标记。 + /// 分组列表。 [HttpGet] [PermissionAuthorize("dictionary:group:read")] [ProducesResponseType(typeof(ApiResponse>), StatusCodes.Status200OK)] @@ -36,6 +39,9 @@ public sealed class DictionaryController(IDictionaryAppService dictionaryAppServ /// /// 创建字典分组。 /// + /// 创建分组请求。 + /// 取消标记。 + /// 创建后的分组。 [HttpPost] [PermissionAuthorize("dictionary:group:create")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -51,6 +57,10 @@ public sealed class DictionaryController(IDictionaryAppService dictionaryAppServ /// /// 更新字典分组。 /// + /// 分组 ID。 + /// 更新请求。 + /// 取消标记。 + /// 更新后的分组。 [HttpPut("{groupId:long}")] [PermissionAuthorize("dictionary:group:update")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -66,6 +76,9 @@ public sealed class DictionaryController(IDictionaryAppService dictionaryAppServ /// /// 删除字典分组。 /// + /// 分组 ID。 + /// 取消标记。 + /// 操作结果。 [HttpDelete("{groupId:long}")] [PermissionAuthorize("dictionary:group:delete")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -81,6 +94,10 @@ public sealed class DictionaryController(IDictionaryAppService dictionaryAppServ /// /// 创建字典项。 /// + /// 分组 ID。 + /// 创建请求。 + /// 取消标记。 + /// 创建的字典项。 [HttpPost("{groupId:long}/items")] [PermissionAuthorize("dictionary:item:create")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -97,6 +114,10 @@ public sealed class DictionaryController(IDictionaryAppService dictionaryAppServ /// /// 更新字典项。 /// + /// 字典项 ID。 + /// 更新请求。 + /// 取消标记。 + /// 更新后的字典项。 [HttpPut("items/{itemId:long}")] [PermissionAuthorize("dictionary:item:update")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -112,6 +133,9 @@ public sealed class DictionaryController(IDictionaryAppService dictionaryAppServ /// /// 删除字典项。 /// + /// 字典项 ID。 + /// 取消标记。 + /// 操作结果。 [HttpDelete("items/{itemId:long}")] [PermissionAuthorize("dictionary:item:delete")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -127,6 +151,9 @@ public sealed class DictionaryController(IDictionaryAppService dictionaryAppServ /// /// 批量获取字典项(命中缓存)。 /// + /// 批量查询请求。 + /// 取消标记。 + /// 分组编码到字典项列表的映射。 [HttpPost("batch")] [ProducesResponseType(typeof(ApiResponse>>), StatusCodes.Status200OK)] public async Task>>> BatchGet([FromBody] DictionaryBatchQueryRequest request, CancellationToken cancellationToken) diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/FilesController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/FilesController.cs index 34091de..a6d77a4 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/FilesController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/FilesController.cs @@ -1,6 +1,4 @@ -using System.Linq; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.Storage.Abstractions; using TakeoutSaaS.Application.Storage.Contracts; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/HealthController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/HealthController.cs index 25edb1b..90dc606 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/HealthController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/HealthController.cs @@ -1,6 +1,4 @@ -using System; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Shared.Abstractions.Results; using TakeoutSaaS.Shared.Web.Api; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/MerchantCategoriesController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/MerchantCategoriesController.cs index 8a930be..497cc87 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/MerchantCategoriesController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/MerchantCategoriesController.cs @@ -1,7 +1,5 @@ -using System.Collections.Generic; using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.App.Merchants.Commands; using TakeoutSaaS.Application.App.Merchants.Dto; @@ -24,6 +22,8 @@ public sealed class MerchantCategoriesController(IMediator mediator) : BaseApiCo /// /// 列出所有类目。 /// + /// 取消标记。 + /// 类目列表。 [HttpGet] [PermissionAuthorize("merchant_category:read")] [ProducesResponseType(typeof(ApiResponse>), StatusCodes.Status200OK)] @@ -39,6 +39,9 @@ public sealed class MerchantCategoriesController(IMediator mediator) : BaseApiCo /// /// 新增类目。 /// + /// 创建命令。 + /// 取消标记。 + /// 创建的类目。 [HttpPost] [PermissionAuthorize("merchant_category:create")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -54,6 +57,9 @@ public sealed class MerchantCategoriesController(IMediator mediator) : BaseApiCo /// /// 删除类目。 /// + /// 类目 ID。 + /// 取消标记。 + /// 删除结果,未找到则返回错误。 [HttpDelete("{categoryId:long}")] [PermissionAuthorize("merchant_category:delete")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -72,6 +78,9 @@ public sealed class MerchantCategoriesController(IMediator mediator) : BaseApiCo /// /// 批量调整类目排序。 /// + /// 排序命令。 + /// 取消标记。 + /// 执行结果。 [HttpPost("reorder")] [PermissionAuthorize("merchant_category:update")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/MerchantsController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/MerchantsController.cs index 828d98b..b886c5c 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/MerchantsController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/MerchantsController.cs @@ -1,6 +1,5 @@ using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.App.Merchants.Commands; using TakeoutSaaS.Application.App.Merchants.Dto; @@ -24,6 +23,9 @@ public sealed class MerchantsController(IMediator mediator) : BaseApiController /// /// 创建商户。 /// + /// 创建命令。 + /// 取消标记。 + /// 创建后的商户。 [HttpPost] [PermissionAuthorize("merchant:create")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -39,6 +41,13 @@ public sealed class MerchantsController(IMediator mediator) : BaseApiController /// /// 查询商户列表。 /// + /// 状态筛选。 + /// 页码。 + /// 每页大小。 + /// 排序字段。 + /// 是否倒序。 + /// 取消标记。 + /// 商户分页结果。 [HttpGet] [PermissionAuthorize("merchant:read")] [ProducesResponseType(typeof(ApiResponse>), StatusCodes.Status200OK)] @@ -67,6 +76,10 @@ public sealed class MerchantsController(IMediator mediator) : BaseApiController /// /// 更新商户。 /// + /// 商户 ID。 + /// 更新命令。 + /// 取消标记。 + /// 更新后的商户或未找到。 [HttpPut("{merchantId:long}")] [PermissionAuthorize("merchant:update")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -91,6 +104,9 @@ public sealed class MerchantsController(IMediator mediator) : BaseApiController /// /// 删除商户。 /// + /// 商户 ID。 + /// 取消标记。 + /// 删除结果。 [HttpDelete("{merchantId:long}")] [PermissionAuthorize("merchant:delete")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -109,6 +125,9 @@ public sealed class MerchantsController(IMediator mediator) : BaseApiController /// /// 获取商户概览。 /// + /// 商户 ID。 + /// 取消标记。 + /// 商户概览或未找到。 [HttpGet("{merchantId:long}")] [PermissionAuthorize("merchant:read")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/OrdersController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/OrdersController.cs index 85f69e4..9a0db09 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/OrdersController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/OrdersController.cs @@ -1,6 +1,5 @@ using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.App.Orders.Commands; using TakeoutSaaS.Application.App.Orders.Dto; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/PaymentsController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/PaymentsController.cs index 83df2fe..ecf4fee 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/PaymentsController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/PaymentsController.cs @@ -1,6 +1,5 @@ using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.App.Payments.Commands; using TakeoutSaaS.Application.App.Payments.Dto; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/PermissionsController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/PermissionsController.cs index c3646b4..5eda408 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/PermissionsController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/PermissionsController.cs @@ -1,7 +1,6 @@ using System.ComponentModel.DataAnnotations; using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.Identity.Commands; using TakeoutSaaS.Application.Identity.Contracts; @@ -26,49 +25,48 @@ public sealed class PermissionsController(IMediator mediator) : BaseApiControlle /// /// 示例:GET /api/admin/v1/permissions?keyword=order&page=1&pageSize=20 /// + /// 查询条件。 + /// 取消标记。 + /// 权限的分页结果。 [HttpGet] [PermissionAuthorize("identity:permission:read")] [ProducesResponseType(typeof(ApiResponse>), StatusCodes.Status200OK)] public async Task>> Search([FromQuery] SearchPermissionsQuery query, CancellationToken cancellationToken) { - // 1. 查询权限分页 var result = await mediator.Send(query, cancellationToken); - - // 2. 返回分页数据 return ApiResponse>.Ok(result); } /// /// 创建权限。 /// + /// 创建命令。 + /// 取消标记。 + /// 创建的权限。 [HttpPost] [PermissionAuthorize("identity:permission:create")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] public async Task> Create([FromBody, Required] CreatePermissionCommand command, CancellationToken cancellationToken) { - // 1. 创建权限 var result = await mediator.Send(command, cancellationToken); - - // 2. 返回创建结果 return ApiResponse.Ok(result); } /// /// 更新权限。 /// + /// 权限 ID。 + /// 更新命令。 + /// 取消标记。 + /// 更新后的权限,未找到时返回 404。 [HttpPut("{permissionId:long}")] [PermissionAuthorize("identity:permission:update")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status404NotFound)] public async Task> Update(long permissionId, [FromBody, Required] UpdatePermissionCommand command, CancellationToken cancellationToken) { - // 1. 绑定权限标识 command = command with { PermissionId = permissionId }; - - // 2. 执行更新 var result = await mediator.Send(command, cancellationToken); - - // 3. 返回更新结果或 404 return result is null ? ApiResponse.Error(StatusCodes.Status404NotFound, "权限不存在") : ApiResponse.Ok(result); @@ -77,15 +75,15 @@ public sealed class PermissionsController(IMediator mediator) : BaseApiControlle /// /// 删除权限。 /// + /// 权限 ID。 + /// 取消标记。 + /// 删除结果。 [HttpDelete("{permissionId:long}")] [PermissionAuthorize("identity:permission:delete")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] public async Task> Delete(long permissionId, CancellationToken cancellationToken) { - // 1. 构建删除命令 var command = new DeletePermissionCommand { PermissionId = permissionId }; - - // 2. 执行删除 var result = await mediator.Send(command, cancellationToken); return ApiResponse.Ok(result); } diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/ProductsController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/ProductsController.cs index 5cd7e8e..1bc75f0 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/ProductsController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/ProductsController.cs @@ -1,6 +1,5 @@ using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.App.Products.Commands; using TakeoutSaaS.Application.App.Products.Dto; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/RolesController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/RolesController.cs index 6a46937..d22f627 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/RolesController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/RolesController.cs @@ -1,9 +1,7 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.Identity.Commands; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Application.Identity.Queries; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/StoresController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/StoresController.cs index 7ae4958..ffcde02 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/StoresController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/StoresController.cs @@ -1,6 +1,5 @@ using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.App.Stores.Commands; using TakeoutSaaS.Application.App.Stores.Dto; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/SystemParametersController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/SystemParametersController.cs index f1f2e8d..7a45183 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/SystemParametersController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/SystemParametersController.cs @@ -1,6 +1,5 @@ using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.App.SystemParameters.Commands; using TakeoutSaaS.Application.App.SystemParameters.Dto; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantAnnouncementsController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantAnnouncementsController.cs index d64b89f..1ba6147 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantAnnouncementsController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantAnnouncementsController.cs @@ -1,8 +1,7 @@ -using System.ComponentModel.DataAnnotations; using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Tenants.Commands; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantBillingsController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantBillingsController.cs index 85ca964..aa306c8 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantBillingsController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantBillingsController.cs @@ -1,8 +1,7 @@ -using System.ComponentModel.DataAnnotations; using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Tenants.Commands; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantNotificationsController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantNotificationsController.cs index dd79892..aa11643 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantNotificationsController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantNotificationsController.cs @@ -1,6 +1,5 @@ using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.App.Tenants.Commands; using TakeoutSaaS.Application.App.Tenants.Dto; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantPackagesController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantPackagesController.cs index 3504bd9..455c095 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantPackagesController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantPackagesController.cs @@ -1,8 +1,7 @@ -using System.ComponentModel.DataAnnotations; using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Tenants.Commands; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; @@ -23,6 +22,9 @@ public sealed class TenantPackagesController(IMediator mediator) : BaseApiContro /// /// 分页查询租户套餐。 /// + /// 查询条件。 + /// 取消标记。 + /// 租户套餐分页结果。 [HttpGet] [PermissionAuthorize("tenant-package:read")] [ProducesResponseType(typeof(ApiResponse>), StatusCodes.Status200OK)] @@ -38,6 +40,9 @@ public sealed class TenantPackagesController(IMediator mediator) : BaseApiContro /// /// 查看套餐详情。 /// + /// 套餐 ID。 + /// 取消标记。 + /// 套餐详情或未找到。 [HttpGet("{tenantPackageId:long}")] [PermissionAuthorize("tenant-package:read")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -56,6 +61,9 @@ public sealed class TenantPackagesController(IMediator mediator) : BaseApiContro /// /// 创建套餐。 /// + /// 创建命令。 + /// 取消标记。 + /// 创建后的套餐。 [HttpPost] [PermissionAuthorize("tenant-package:create")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -71,6 +79,10 @@ public sealed class TenantPackagesController(IMediator mediator) : BaseApiContro /// /// 更新套餐。 /// + /// 套餐 ID。 + /// 更新命令。 + /// 取消标记。 + /// 更新后的套餐或未找到。 [HttpPut("{tenantPackageId:long}")] [PermissionAuthorize("tenant-package:update")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -92,6 +104,9 @@ public sealed class TenantPackagesController(IMediator mediator) : BaseApiContro /// /// 删除套餐。 /// + /// 套餐 ID。 + /// 取消标记。 + /// 删除结果。 [HttpDelete("{tenantPackageId:long}")] [PermissionAuthorize("tenant-package:delete")] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantsController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantsController.cs index 0d91ee2..585ab2c 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantsController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/TenantsController.cs @@ -1,13 +1,11 @@ -using System.ComponentModel.DataAnnotations; using MediatR; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Tenants.Commands; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; using TakeoutSaaS.Module.Authorization.Attributes; -using TakeoutSaaS.Shared.Abstractions.Constants; using TakeoutSaaS.Shared.Abstractions.Results; using TakeoutSaaS.Shared.Web.Api; diff --git a/src/Api/TakeoutSaaS.AdminApi/Controllers/UserPermissionsController.cs b/src/Api/TakeoutSaaS.AdminApi/Controllers/UserPermissionsController.cs index f2f54e2..c6a4a04 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Controllers/UserPermissionsController.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Controllers/UserPermissionsController.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.Identity.Abstractions; using TakeoutSaaS.Application.Identity.Contracts; @@ -51,6 +50,9 @@ public sealed class UserPermissionsController(IAdminAuthService authService) : B /// } /// /// + /// 搜索条件。 + /// 取消标记。 + /// 分页的用户权限概览。 [HttpGet] [PermissionAuthorize("identity:permission:read")] [ProducesResponseType(typeof(ApiResponse>), StatusCodes.Status200OK)] diff --git a/src/Api/TakeoutSaaS.AdminApi/Program.cs b/src/Api/TakeoutSaaS.AdminApi/Program.cs index 432bd87..3b0c4b6 100644 --- a/src/Api/TakeoutSaaS.AdminApi/Program.cs +++ b/src/Api/TakeoutSaaS.AdminApi/Program.cs @@ -1,10 +1,4 @@ -using System; -using System.Linq; -using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Cors.Infrastructure; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; using OpenTelemetry.Metrics; using OpenTelemetry.Resources; using OpenTelemetry.Trace; @@ -101,6 +95,7 @@ builder.Services.AddOpenTelemetry() exporter.Endpoint = new Uri(otelEndpoint); }); } + if (useConsoleExporter) { tracing.AddConsoleExporter(); @@ -120,6 +115,7 @@ builder.Services.AddOpenTelemetry() exporter.Endpoint = new Uri(otelEndpoint); }); } + if (useConsoleExporter) { metrics.AddConsoleExporter(); @@ -172,6 +168,7 @@ static void ConfigureCorsPolicy(CorsPolicyBuilder policy, string[] origins) policy.WithOrigins(origins) .AllowCredentials(); } + policy .AllowAnyHeader() .AllowAnyMethod(); diff --git a/src/Api/TakeoutSaaS.MiniApi/Controllers/AuthController.cs b/src/Api/TakeoutSaaS.MiniApi/Controllers/AuthController.cs index 5062afd..11e7d10 100644 --- a/src/Api/TakeoutSaaS.MiniApi/Controllers/AuthController.cs +++ b/src/Api/TakeoutSaaS.MiniApi/Controllers/AuthController.cs @@ -20,6 +20,9 @@ public sealed class AuthController(IMiniAuthService authService) : BaseApiContro /// /// 微信登录 /// + /// 微信登录请求。 + /// 取消标记。 + /// 包含访问令牌与刷新令牌的响应。 [HttpPost("wechat/login")] [AllowAnonymous] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] @@ -35,6 +38,9 @@ public sealed class AuthController(IMiniAuthService authService) : BaseApiContro /// /// 刷新 Token /// + /// 刷新令牌请求。 + /// 取消标记。 + /// 新的访问令牌与刷新令牌。 [HttpPost("refresh")] [AllowAnonymous] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] diff --git a/src/Api/TakeoutSaaS.MiniApi/Controllers/FilesController.cs b/src/Api/TakeoutSaaS.MiniApi/Controllers/FilesController.cs index 67d5961..0d651fb 100644 --- a/src/Api/TakeoutSaaS.MiniApi/Controllers/FilesController.cs +++ b/src/Api/TakeoutSaaS.MiniApi/Controllers/FilesController.cs @@ -1,6 +1,4 @@ -using System.Linq; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.Storage.Abstractions; using TakeoutSaaS.Application.Storage.Contracts; @@ -22,6 +20,10 @@ public sealed class FilesController(IFileStorageService fileStorageService) : Ba /// /// 上传图片或文件。 /// + /// 上传文件。 + /// 上传类型。 + /// 取消标记。 + /// 上传结果,包含访问链接等信息。 [HttpPost("upload")] [RequestFormLimits(MultipartBodyLengthLimit = 30 * 1024 * 1024)] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] diff --git a/src/Api/TakeoutSaaS.MiniApi/Controllers/HealthController.cs b/src/Api/TakeoutSaaS.MiniApi/Controllers/HealthController.cs index d4e9920..e19775c 100644 --- a/src/Api/TakeoutSaaS.MiniApi/Controllers/HealthController.cs +++ b/src/Api/TakeoutSaaS.MiniApi/Controllers/HealthController.cs @@ -1,6 +1,4 @@ -using System; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Shared.Abstractions.Results; using TakeoutSaaS.Shared.Web.Api; diff --git a/src/Api/TakeoutSaaS.MiniApi/Controllers/MeController.cs b/src/Api/TakeoutSaaS.MiniApi/Controllers/MeController.cs index 4c29f25..7411644 100644 --- a/src/Api/TakeoutSaaS.MiniApi/Controllers/MeController.cs +++ b/src/Api/TakeoutSaaS.MiniApi/Controllers/MeController.cs @@ -1,8 +1,4 @@ -using System; -using System.Threading; -using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Application.Identity.Abstractions; using TakeoutSaaS.Application.Identity.Contracts; @@ -26,6 +22,8 @@ public sealed class MeController(IMiniAuthService authService) : BaseApiControll /// /// 获取用户档案 /// + /// 取消标记。 + /// 当前用户档案信息。 [HttpGet] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status401Unauthorized)] diff --git a/src/Api/TakeoutSaaS.MiniApi/Program.cs b/src/Api/TakeoutSaaS.MiniApi/Program.cs index d4df34c..8369004 100644 --- a/src/Api/TakeoutSaaS.MiniApi/Program.cs +++ b/src/Api/TakeoutSaaS.MiniApi/Program.cs @@ -1,7 +1,4 @@ -using System; -using System.Linq; using Microsoft.AspNetCore.Cors.Infrastructure; -using Microsoft.Extensions.Configuration; using OpenTelemetry.Metrics; using OpenTelemetry.Resources; using OpenTelemetry.Trace; diff --git a/src/Api/TakeoutSaaS.UserApi/Controllers/HealthController.cs b/src/Api/TakeoutSaaS.UserApi/Controllers/HealthController.cs index 0056def..08fe92b 100644 --- a/src/Api/TakeoutSaaS.UserApi/Controllers/HealthController.cs +++ b/src/Api/TakeoutSaaS.UserApi/Controllers/HealthController.cs @@ -1,6 +1,4 @@ -using System; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using TakeoutSaaS.Shared.Abstractions.Results; using TakeoutSaaS.Shared.Web.Api; diff --git a/src/Api/TakeoutSaaS.UserApi/Program.cs b/src/Api/TakeoutSaaS.UserApi/Program.cs index a531e11..d59e501 100644 --- a/src/Api/TakeoutSaaS.UserApi/Program.cs +++ b/src/Api/TakeoutSaaS.UserApi/Program.cs @@ -1,7 +1,4 @@ -using System; -using System.Linq; using Microsoft.AspNetCore.Cors.Infrastructure; -using Microsoft.Extensions.Configuration; using OpenTelemetry.Metrics; using OpenTelemetry.Resources; using OpenTelemetry.Trace; diff --git a/src/Application/TakeoutSaaS.Application/App/Extensions/AppApplicationServiceCollectionExtensions.cs b/src/Application/TakeoutSaaS.Application/App/Extensions/AppApplicationServiceCollectionExtensions.cs index 62284b1..c4af1ce 100644 --- a/src/Application/TakeoutSaaS.Application/App/Extensions/AppApplicationServiceCollectionExtensions.cs +++ b/src/Application/TakeoutSaaS.Application/App/Extensions/AppApplicationServiceCollectionExtensions.cs @@ -1,7 +1,7 @@ -using System.Reflection; using FluentValidation; using MediatR; using Microsoft.Extensions.DependencyInjection; +using System.Reflection; using TakeoutSaaS.Application.App.Common.Behaviors; namespace TakeoutSaaS.Application.App.Extensions; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/AddMerchantDocumentCommand.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/AddMerchantDocumentCommand.cs index cf0d4a3..bc40f63 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/AddMerchantDocumentCommand.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/AddMerchantDocumentCommand.cs @@ -1,6 +1,5 @@ -using System; -using System.ComponentModel.DataAnnotations; using MediatR; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Merchants.Dto; using TakeoutSaaS.Domain.Merchants.Enums; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/CreateMerchantCategoryCommand.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/CreateMerchantCategoryCommand.cs index 115d4ba..fe01142 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/CreateMerchantCategoryCommand.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/CreateMerchantCategoryCommand.cs @@ -1,5 +1,5 @@ -using System.ComponentModel.DataAnnotations; using MediatR; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Merchants.Dto; namespace TakeoutSaaS.Application.App.Merchants.Commands; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/CreateMerchantContractCommand.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/CreateMerchantContractCommand.cs index 176cf98..957ba01 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/CreateMerchantContractCommand.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/CreateMerchantContractCommand.cs @@ -1,6 +1,5 @@ -using System; -using System.ComponentModel.DataAnnotations; using MediatR; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Merchants.Dto; namespace TakeoutSaaS.Application.App.Merchants.Commands; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/DeleteMerchantCategoryCommand.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/DeleteMerchantCategoryCommand.cs index ffa0326..98cfd21 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/DeleteMerchantCategoryCommand.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/DeleteMerchantCategoryCommand.cs @@ -1,5 +1,5 @@ -using System.ComponentModel.DataAnnotations; using MediatR; +using System.ComponentModel.DataAnnotations; namespace TakeoutSaaS.Application.App.Merchants.Commands; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReorderMerchantCategoriesCommand.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReorderMerchantCategoriesCommand.cs index 79bd657..542e6aa 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReorderMerchantCategoriesCommand.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReorderMerchantCategoriesCommand.cs @@ -1,6 +1,5 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using MediatR; +using System.ComponentModel.DataAnnotations; namespace TakeoutSaaS.Application.App.Merchants.Commands; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReviewMerchantCommand.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReviewMerchantCommand.cs index 792cddc..362e20b 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReviewMerchantCommand.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReviewMerchantCommand.cs @@ -1,5 +1,5 @@ -using System.ComponentModel.DataAnnotations; using MediatR; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Merchants.Dto; namespace TakeoutSaaS.Application.App.Merchants.Commands; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReviewMerchantDocumentCommand.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReviewMerchantDocumentCommand.cs index 23d6e2a..0e01c26 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReviewMerchantDocumentCommand.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/ReviewMerchantDocumentCommand.cs @@ -1,5 +1,5 @@ -using System.ComponentModel.DataAnnotations; using MediatR; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Merchants.Dto; namespace TakeoutSaaS.Application.App.Merchants.Commands; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/UpdateMerchantContractStatusCommand.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/UpdateMerchantContractStatusCommand.cs index 3514b58..f89f9bf 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/UpdateMerchantContractStatusCommand.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Commands/UpdateMerchantContractStatusCommand.cs @@ -1,6 +1,5 @@ -using System; -using System.ComponentModel.DataAnnotations; using MediatR; +using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Application.App.Merchants.Dto; using TakeoutSaaS.Domain.Merchants.Enums; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantCategoryDto.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantCategoryDto.cs index 0d8636b..c8741ca 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantCategoryDto.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantCategoryDto.cs @@ -1,5 +1,3 @@ -using System; - namespace TakeoutSaaS.Application.App.Merchants.Dto; /// diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantDetailDto.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantDetailDto.cs index 4c8dedb..2fa8b95 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantDetailDto.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantDetailDto.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace TakeoutSaaS.Application.App.Merchants.Dto; /// diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/CreateMerchantCategoryCommandHandler.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/CreateMerchantCategoryCommandHandler.cs index c94e995..645189c 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/CreateMerchantCategoryCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/CreateMerchantCategoryCommandHandler.cs @@ -1,4 +1,3 @@ -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Merchants.Commands; using TakeoutSaaS.Application.App.Merchants.Dto; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantAuditLogsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantAuditLogsQueryHandler.cs index cfb010d..2fd67e5 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantAuditLogsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantAuditLogsQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Merchants.Dto; using TakeoutSaaS.Application.App.Merchants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantCategoriesQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantCategoriesQueryHandler.cs index 19c9b2f..4ffc992 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantCategoriesQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantCategoriesQueryHandler.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Merchants.Queries; using TakeoutSaaS.Domain.Merchants.Repositories; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantContractsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantContractsQueryHandler.cs index 46842e1..8ce236b 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantContractsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantContractsQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.App.Merchants.Dto; using TakeoutSaaS.Application.App.Merchants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantDocumentsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantDocumentsQueryHandler.cs index 3be839c..c93f19c 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantDocumentsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/GetMerchantDocumentsQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.App.Merchants.Dto; using TakeoutSaaS.Application.App.Merchants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ListMerchantCategoriesQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ListMerchantCategoriesQueryHandler.cs index 7da5375..c0ba13b 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ListMerchantCategoriesQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ListMerchantCategoriesQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.App.Merchants.Dto; using TakeoutSaaS.Application.App.Merchants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ReorderMerchantCategoriesCommandHandler.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ReorderMerchantCategoriesCommandHandler.cs index e06ea65..cb71205 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ReorderMerchantCategoriesCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ReorderMerchantCategoriesCommandHandler.cs @@ -1,4 +1,3 @@ -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Merchants.Commands; using TakeoutSaaS.Domain.Merchants.Repositories; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ReviewMerchantDocumentCommandHandler.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ReviewMerchantDocumentCommandHandler.cs index a8fe365..7260afb 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ReviewMerchantDocumentCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Handlers/ReviewMerchantDocumentCommandHandler.cs @@ -1,8 +1,8 @@ using MediatR; using TakeoutSaaS.Application.App.Merchants.Commands; using TakeoutSaaS.Application.App.Merchants.Dto; -using TakeoutSaaS.Domain.Merchants.Enums; using TakeoutSaaS.Domain.Merchants.Entities; +using TakeoutSaaS.Domain.Merchants.Enums; using TakeoutSaaS.Domain.Merchants.Repositories; using TakeoutSaaS.Shared.Abstractions.Constants; using TakeoutSaaS.Shared.Abstractions.Exceptions; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/MerchantMapping.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/MerchantMapping.cs index 8c61873..4b52d54 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/MerchantMapping.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/MerchantMapping.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.Linq; using TakeoutSaaS.Application.App.Merchants.Dto; using TakeoutSaaS.Domain.Merchants.Entities; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantCategoriesQuery.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantCategoriesQuery.cs index c55fd86..558bcc6 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantCategoriesQuery.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantCategoriesQuery.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; namespace TakeoutSaaS.Application.App.Merchants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantContractsQuery.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantContractsQuery.cs index 8940465..bdf17d6 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantContractsQuery.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantContractsQuery.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.App.Merchants.Dto; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantDocumentsQuery.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantDocumentsQuery.cs index 997f02a..f3dd1bf 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantDocumentsQuery.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/GetMerchantDocumentsQuery.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.App.Merchants.Dto; diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/ListMerchantCategoriesQuery.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/ListMerchantCategoriesQuery.cs index 4e4ef4a..5fa29e9 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/ListMerchantCategoriesQuery.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Queries/ListMerchantCategoriesQuery.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.App.Merchants.Dto; diff --git a/src/Application/TakeoutSaaS.Application/App/Orders/Handlers/CreateOrderCommandHandler.cs b/src/Application/TakeoutSaaS.Application/App/Orders/Handlers/CreateOrderCommandHandler.cs index 8d38f2c..9b3cc0f 100644 --- a/src/Application/TakeoutSaaS.Application/App/Orders/Handlers/CreateOrderCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Orders/Handlers/CreateOrderCommandHandler.cs @@ -78,6 +78,7 @@ public sealed class CreateOrderCommandHandler( { await orderRepository.AddItemsAsync(items, cancellationToken); } + await orderRepository.SaveChangesAsync(cancellationToken); // 5. 记录日志 diff --git a/src/Application/TakeoutSaaS.Application/App/Payments/Handlers/SearchPaymentsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Payments/Handlers/SearchPaymentsQueryHandler.cs index 9d6c4ae..a265022 100644 --- a/src/Application/TakeoutSaaS.Application/App/Payments/Handlers/SearchPaymentsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Payments/Handlers/SearchPaymentsQueryHandler.cs @@ -1,7 +1,6 @@ using MediatR; using TakeoutSaaS.Application.App.Payments.Dto; using TakeoutSaaS.Application.App.Payments.Queries; -using TakeoutSaaS.Domain.Payments.Entities; using TakeoutSaaS.Domain.Payments.Repositories; using TakeoutSaaS.Shared.Abstractions.Results; using TakeoutSaaS.Shared.Abstractions.Tenancy; diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/CheckTenantQuotaCommandHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/CheckTenantQuotaCommandHandler.cs index 5fc67aa..169ddbb 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/CheckTenantQuotaCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/CheckTenantQuotaCommandHandler.cs @@ -1,4 +1,3 @@ -using System; using MediatR; using TakeoutSaaS.Application.App.Tenants.Commands; using TakeoutSaaS.Application.App.Tenants.Dto; diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/GetTenantAuditLogsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/GetTenantAuditLogsQueryHandler.cs index 41d308f..76aafb6 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/GetTenantAuditLogsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/GetTenantAuditLogsQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/MarkTenantAnnouncementReadCommandHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/MarkTenantAnnouncementReadCommandHandler.cs index 8c0a06b..1600ecf 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/MarkTenantAnnouncementReadCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/MarkTenantAnnouncementReadCommandHandler.cs @@ -3,8 +3,6 @@ using TakeoutSaaS.Application.App.Tenants.Commands; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Repositories; -using TakeoutSaaS.Shared.Abstractions.Constants; -using TakeoutSaaS.Shared.Abstractions.Exceptions; using TakeoutSaaS.Shared.Abstractions.Security; namespace TakeoutSaaS.Application.App.Tenants.Handlers; diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantAnnouncementsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantAnnouncementsQueryHandler.cs index be2b952..2c15546 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantAnnouncementsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantAnnouncementsQueryHandler.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantBillsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantBillsQueryHandler.cs index 05b11cb..66821fc 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantBillsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantBillsQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantNotificationsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantNotificationsQueryHandler.cs index bab5aca..294a639 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantNotificationsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantNotificationsQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantPackagesQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantPackagesQueryHandler.cs index 12a2318..21c3ba7 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantPackagesQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantPackagesQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantsQueryHandler.cs index 2813e31..755b911 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/SearchTenantsQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Linq; using MediatR; using TakeoutSaaS.Application.App.Tenants.Dto; using TakeoutSaaS.Application.App.Tenants.Queries; diff --git a/src/Application/TakeoutSaaS.Application/Dictionary/Abstractions/IDictionaryCache.cs b/src/Application/TakeoutSaaS.Application/Dictionary/Abstractions/IDictionaryCache.cs index ebdc59f..f9ea54b 100644 --- a/src/Application/TakeoutSaaS.Application/Dictionary/Abstractions/IDictionaryCache.cs +++ b/src/Application/TakeoutSaaS.Application/Dictionary/Abstractions/IDictionaryCache.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Application.Dictionary.Models; namespace TakeoutSaaS.Application.Dictionary.Abstractions; diff --git a/src/Application/TakeoutSaaS.Application/Dictionary/Contracts/CreateDictionaryItemRequest.cs b/src/Application/TakeoutSaaS.Application/Dictionary/Contracts/CreateDictionaryItemRequest.cs index 668d369..b19ccce 100644 --- a/src/Application/TakeoutSaaS.Application/Dictionary/Contracts/CreateDictionaryItemRequest.cs +++ b/src/Application/TakeoutSaaS.Application/Dictionary/Contracts/CreateDictionaryItemRequest.cs @@ -1,6 +1,6 @@ +using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; using TakeoutSaaS.Shared.Abstractions.Serialization; -using System.ComponentModel.DataAnnotations; namespace TakeoutSaaS.Application.Dictionary.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Dictionary/Models/DictionaryGroupDto.cs b/src/Application/TakeoutSaaS.Application/Dictionary/Models/DictionaryGroupDto.cs index 95a81f0..cdee6bf 100644 --- a/src/Application/TakeoutSaaS.Application/Dictionary/Models/DictionaryGroupDto.cs +++ b/src/Application/TakeoutSaaS.Application/Dictionary/Models/DictionaryGroupDto.cs @@ -1,6 +1,5 @@ -using TakeoutSaaS.Domain.Dictionary.Enums; - using System.Text.Json.Serialization; +using TakeoutSaaS.Domain.Dictionary.Enums; using TakeoutSaaS.Shared.Abstractions.Serialization; namespace TakeoutSaaS.Application.Dictionary.Models; diff --git a/src/Application/TakeoutSaaS.Application/Dictionary/Services/DictionaryAppService.cs b/src/Application/TakeoutSaaS.Application/Dictionary/Services/DictionaryAppService.cs index 1c8f628..65616a8 100644 --- a/src/Application/TakeoutSaaS.Application/Dictionary/Services/DictionaryAppService.cs +++ b/src/Application/TakeoutSaaS.Application/Dictionary/Services/DictionaryAppService.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.Extensions.Logging; using TakeoutSaaS.Application.Dictionary.Abstractions; using TakeoutSaaS.Application.Dictionary.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IAdminAuthService.cs b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IAdminAuthService.cs index d1cd0a7..8961c72 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IAdminAuthService.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IAdminAuthService.cs @@ -1,6 +1,3 @@ -using System; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Shared.Abstractions.Results; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IJwtTokenService.cs b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IJwtTokenService.cs index 4235181..5bf401e 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IJwtTokenService.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IJwtTokenService.cs @@ -1,5 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Application.Identity.Contracts; namespace TakeoutSaaS.Application.Identity.Abstractions; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/ILoginRateLimiter.cs b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/ILoginRateLimiter.cs index f4a7c5c..66f91a9 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/ILoginRateLimiter.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/ILoginRateLimiter.cs @@ -1,6 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; - namespace TakeoutSaaS.Application.Identity.Abstractions; /// diff --git a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IMiniAuthService.cs b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IMiniAuthService.cs index c7a509e..8c5250a 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IMiniAuthService.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IMiniAuthService.cs @@ -1,6 +1,3 @@ -using System; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Application.Identity.Contracts; namespace TakeoutSaaS.Application.Identity.Abstractions; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IRefreshTokenStore.cs b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IRefreshTokenStore.cs index 29a1bf6..938b4cf 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IRefreshTokenStore.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IRefreshTokenStore.cs @@ -1,6 +1,3 @@ -using System; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Application.Identity.Models; namespace TakeoutSaaS.Application.Identity.Abstractions; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IWeChatAuthService.cs b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IWeChatAuthService.cs index 417c8b9..c53b72c 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IWeChatAuthService.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Abstractions/IWeChatAuthService.cs @@ -1,6 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; - namespace TakeoutSaaS.Application.Identity.Abstractions; /// diff --git a/src/Application/TakeoutSaaS.Application/Identity/Commands/CreateRoleTemplateCommand.cs b/src/Application/TakeoutSaaS.Application/Identity/Commands/CreateRoleTemplateCommand.cs index 7ca69d1..de2bd4c 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Commands/CreateRoleTemplateCommand.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Commands/CreateRoleTemplateCommand.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Commands/InitializeRoleTemplatesCommand.cs b/src/Application/TakeoutSaaS.Application/Identity/Commands/InitializeRoleTemplatesCommand.cs index dc1a583..7eb39f9 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Commands/InitializeRoleTemplatesCommand.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Commands/InitializeRoleTemplatesCommand.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Commands/UpdateRoleTemplateCommand.cs b/src/Application/TakeoutSaaS.Application/Identity/Commands/UpdateRoleTemplateCommand.cs index d88b3ba..ee6d5bf 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Commands/UpdateRoleTemplateCommand.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Commands/UpdateRoleTemplateCommand.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Contracts/RoleTemplateDto.cs b/src/Application/TakeoutSaaS.Application/Identity/Contracts/RoleTemplateDto.cs index 4690fa2..d3d9415 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Contracts/RoleTemplateDto.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Contracts/RoleTemplateDto.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace TakeoutSaaS.Application.Identity.Contracts; /// diff --git a/src/Application/TakeoutSaaS.Application/Identity/Contracts/UserPermissionDto.cs b/src/Application/TakeoutSaaS.Application/Identity/Contracts/UserPermissionDto.cs index f3393ad..3506491 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Contracts/UserPermissionDto.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Contracts/UserPermissionDto.cs @@ -1,4 +1,3 @@ -using System; using System.Text.Json.Serialization; using TakeoutSaaS.Shared.Abstractions.Serialization; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/CopyRoleTemplateCommandHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/CopyRoleTemplateCommandHandler.cs index e254b5f..807371a 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/CopyRoleTemplateCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/CopyRoleTemplateCommandHandler.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Commands; using TakeoutSaaS.Application.Identity.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/CreateRoleTemplateCommandHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/CreateRoleTemplateCommandHandler.cs index b418306..2bec7ea 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/CreateRoleTemplateCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/CreateRoleTemplateCommandHandler.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Commands; using TakeoutSaaS.Application.Identity.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/GetRoleTemplateQueryHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/GetRoleTemplateQueryHandler.cs index 2895c7d..be16a6e 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/GetRoleTemplateQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/GetRoleTemplateQueryHandler.cs @@ -1,4 +1,3 @@ -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Application.Identity.Queries; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/GetUserPermissionsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/GetUserPermissionsQueryHandler.cs index d50be4b..915f386 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/GetUserPermissionsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/GetUserPermissionsQueryHandler.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Application.Identity.Queries; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/InitializeRoleTemplatesCommandHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/InitializeRoleTemplatesCommandHandler.cs index 483b336..7ec7a0e 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/InitializeRoleTemplatesCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/InitializeRoleTemplatesCommandHandler.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Commands; using TakeoutSaaS.Application.Identity.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/ListRoleTemplatesQueryHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/ListRoleTemplatesQueryHandler.cs index 571ebf5..e99254b 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/ListRoleTemplatesQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/ListRoleTemplatesQueryHandler.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Application.Identity.Queries; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchPermissionsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchPermissionsQueryHandler.cs index 62a4ce9..df6245b 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchPermissionsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchPermissionsQueryHandler.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Application.Identity.Queries; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchRolesQueryHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchRolesQueryHandler.cs index 3e18b69..7309de3 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchRolesQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchRolesQueryHandler.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Application.Identity.Queries; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchUserPermissionsQueryHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchUserPermissionsQueryHandler.cs index 599d6fd..4184be8 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchUserPermissionsQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchUserPermissionsQueryHandler.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Application.Identity.Queries; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/TemplateMapper.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/TemplateMapper.cs index 73e0509..aaf6d71 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/TemplateMapper.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/TemplateMapper.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.Linq; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Domain.Identity.Entities; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/UpdateRoleTemplateCommandHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/UpdateRoleTemplateCommandHandler.cs index 1f07395..a98bf6e 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/UpdateRoleTemplateCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/UpdateRoleTemplateCommandHandler.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; using MediatR; using TakeoutSaaS.Application.Identity.Commands; using TakeoutSaaS.Application.Identity.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Queries/ListRoleTemplatesQuery.cs b/src/Application/TakeoutSaaS.Application/Identity/Queries/ListRoleTemplatesQuery.cs index 7da3def..1b76a6d 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Queries/ListRoleTemplatesQuery.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Queries/ListRoleTemplatesQuery.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using MediatR; using TakeoutSaaS.Application.Identity.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Identity/Services/AdminAuthService.cs b/src/Application/TakeoutSaaS.Application/Identity/Services/AdminAuthService.cs index 4836eb8..72e8f2d 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Services/AdminAuthService.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Services/AdminAuthService.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; using Microsoft.AspNetCore.Identity; using TakeoutSaaS.Application.Identity.Abstractions; using TakeoutSaaS.Application.Identity.Contracts; @@ -80,7 +77,7 @@ public sealed class AdminAuthService( // 3. 撤销旧刷新令牌(防止重复使用) await refreshTokenStore.RevokeAsync(descriptor.Token, cancellationToken); - + // 4. 生成新的令牌对 var profile = await BuildProfileAsync(user, cancellationToken); return await jwtTokenService.CreateTokensAsync(profile, false, cancellationToken); diff --git a/src/Application/TakeoutSaaS.Application/Identity/Services/MiniAuthService.cs b/src/Application/TakeoutSaaS.Application/Identity/Services/MiniAuthService.cs index 5d83289..8234d7e 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Services/MiniAuthService.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Services/MiniAuthService.cs @@ -1,5 +1,5 @@ -using System.Net; using Microsoft.AspNetCore.Http; +using System.Net; using TakeoutSaaS.Application.Identity.Abstractions; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Domain.Identity.Entities; @@ -54,7 +54,7 @@ public sealed class MiniAuthService( // 5. 登录成功后重置限流计数 await rateLimiter.ResetAsync(throttleKey, cancellationToken); - + // 6. 构建用户档案并生成令牌 var profile = BuildProfile(user); return await jwtTokenService.CreateTokensAsync(profile, isNew, cancellationToken); @@ -82,7 +82,7 @@ public sealed class MiniAuthService( // 3. 撤销旧刷新令牌(防止重复使用) await refreshTokenStore.RevokeAsync(descriptor.Token, cancellationToken); - + // 4. 生成新的令牌对 var profile = BuildProfile(user); return await jwtTokenService.CreateTokensAsync(profile, false, cancellationToken); diff --git a/src/Application/TakeoutSaaS.Application/Messaging/Abstractions/IEventPublisher.cs b/src/Application/TakeoutSaaS.Application/Messaging/Abstractions/IEventPublisher.cs index b471f0a..c17a6f7 100644 --- a/src/Application/TakeoutSaaS.Application/Messaging/Abstractions/IEventPublisher.cs +++ b/src/Application/TakeoutSaaS.Application/Messaging/Abstractions/IEventPublisher.cs @@ -1,6 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; - namespace TakeoutSaaS.Application.Messaging.Abstractions; /// diff --git a/src/Application/TakeoutSaaS.Application/Messaging/Services/EventPublisher.cs b/src/Application/TakeoutSaaS.Application/Messaging/Services/EventPublisher.cs index 60b04d3..d87dc80 100644 --- a/src/Application/TakeoutSaaS.Application/Messaging/Services/EventPublisher.cs +++ b/src/Application/TakeoutSaaS.Application/Messaging/Services/EventPublisher.cs @@ -1,5 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Application.Messaging.Abstractions; using TakeoutSaaS.Module.Messaging.Abstractions; diff --git a/src/Application/TakeoutSaaS.Application/Sms/Abstractions/IVerificationCodeService.cs b/src/Application/TakeoutSaaS.Application/Sms/Abstractions/IVerificationCodeService.cs index 514b843..4eab7cc 100644 --- a/src/Application/TakeoutSaaS.Application/Sms/Abstractions/IVerificationCodeService.cs +++ b/src/Application/TakeoutSaaS.Application/Sms/Abstractions/IVerificationCodeService.cs @@ -1,5 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Application.Sms.Contracts; namespace TakeoutSaaS.Application.Sms.Abstractions; diff --git a/src/Application/TakeoutSaaS.Application/Sms/Contracts/SendVerificationCodeResponse.cs b/src/Application/TakeoutSaaS.Application/Sms/Contracts/SendVerificationCodeResponse.cs index 5b6cf77..e9f84f1 100644 --- a/src/Application/TakeoutSaaS.Application/Sms/Contracts/SendVerificationCodeResponse.cs +++ b/src/Application/TakeoutSaaS.Application/Sms/Contracts/SendVerificationCodeResponse.cs @@ -1,5 +1,3 @@ -using System; - namespace TakeoutSaaS.Application.Sms.Contracts; /// diff --git a/src/Application/TakeoutSaaS.Application/Sms/Services/VerificationCodeService.cs b/src/Application/TakeoutSaaS.Application/Sms/Services/VerificationCodeService.cs index 70048b1..1fbac0f 100644 --- a/src/Application/TakeoutSaaS.Application/Sms/Services/VerificationCodeService.cs +++ b/src/Application/TakeoutSaaS.Application/Sms/Services/VerificationCodeService.cs @@ -1,15 +1,14 @@ -using System.Security.Cryptography; -using System.Text; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using System.Security.Cryptography; +using System.Text; using TakeoutSaaS.Application.Sms.Abstractions; using TakeoutSaaS.Application.Sms.Contracts; using TakeoutSaaS.Application.Sms.Options; using TakeoutSaaS.Module.Sms.Abstractions; using TakeoutSaaS.Module.Sms.Models; using TakeoutSaaS.Module.Sms.Options; -using TakeoutSaaS.Module.Sms; using TakeoutSaaS.Shared.Abstractions.Constants; using TakeoutSaaS.Shared.Abstractions.Exceptions; using TakeoutSaaS.Shared.Abstractions.Tenancy; diff --git a/src/Application/TakeoutSaaS.Application/Storage/Abstractions/IFileStorageService.cs b/src/Application/TakeoutSaaS.Application/Storage/Abstractions/IFileStorageService.cs index f164c5c..b92f66d 100644 --- a/src/Application/TakeoutSaaS.Application/Storage/Abstractions/IFileStorageService.cs +++ b/src/Application/TakeoutSaaS.Application/Storage/Abstractions/IFileStorageService.cs @@ -1,5 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Application.Storage.Contracts; namespace TakeoutSaaS.Application.Storage.Abstractions; diff --git a/src/Application/TakeoutSaaS.Application/Storage/Contracts/DirectUploadResponse.cs b/src/Application/TakeoutSaaS.Application/Storage/Contracts/DirectUploadResponse.cs index 4989657..de1ab0b 100644 --- a/src/Application/TakeoutSaaS.Application/Storage/Contracts/DirectUploadResponse.cs +++ b/src/Application/TakeoutSaaS.Application/Storage/Contracts/DirectUploadResponse.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - namespace TakeoutSaaS.Application.Storage.Contracts; /// diff --git a/src/Application/TakeoutSaaS.Application/Storage/Contracts/UploadFileRequest.cs b/src/Application/TakeoutSaaS.Application/Storage/Contracts/UploadFileRequest.cs index 011f39d..43e12f2 100644 --- a/src/Application/TakeoutSaaS.Application/Storage/Contracts/UploadFileRequest.cs +++ b/src/Application/TakeoutSaaS.Application/Storage/Contracts/UploadFileRequest.cs @@ -1,4 +1,3 @@ -using System.IO; using TakeoutSaaS.Application.Storage.Enums; namespace TakeoutSaaS.Application.Storage.Contracts; diff --git a/src/Application/TakeoutSaaS.Application/Storage/Extensions/UploadFileTypeParser.cs b/src/Application/TakeoutSaaS.Application/Storage/Extensions/UploadFileTypeParser.cs index dd712ba..89efe3d 100644 --- a/src/Application/TakeoutSaaS.Application/Storage/Extensions/UploadFileTypeParser.cs +++ b/src/Application/TakeoutSaaS.Application/Storage/Extensions/UploadFileTypeParser.cs @@ -1,4 +1,3 @@ -using System; using TakeoutSaaS.Application.Storage.Enums; namespace TakeoutSaaS.Application.Storage.Extensions; diff --git a/src/Application/TakeoutSaaS.Application/Storage/Services/FileStorageService.cs b/src/Application/TakeoutSaaS.Application/Storage/Services/FileStorageService.cs index 6ce4e2c..a887bf9 100644 --- a/src/Application/TakeoutSaaS.Application/Storage/Services/FileStorageService.cs +++ b/src/Application/TakeoutSaaS.Application/Storage/Services/FileStorageService.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Threading; -using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using System.Security.Cryptography; +using System.Text; using TakeoutSaaS.Application.Storage.Abstractions; using TakeoutSaaS.Application.Storage.Contracts; using TakeoutSaaS.Application.Storage.Enums; diff --git a/src/Core/TakeoutSaaS.Shared.Abstractions/Data/IDapperExecutor.cs b/src/Core/TakeoutSaaS.Shared.Abstractions/Data/IDapperExecutor.cs index 3783a93..0423468 100644 --- a/src/Core/TakeoutSaaS.Shared.Abstractions/Data/IDapperExecutor.cs +++ b/src/Core/TakeoutSaaS.Shared.Abstractions/Data/IDapperExecutor.cs @@ -29,6 +29,7 @@ public interface IDapperExecutor /// 连接角色(读/写)。 /// 命令委托,提供已打开的连接和取消标记。 /// 取消标记。 + /// 异步执行任务。 Task ExecuteAsync( string dataSourceName, DatabaseConnectionRole role, diff --git a/src/Core/TakeoutSaaS.Shared.Abstractions/Diagnostics/TraceContext.cs b/src/Core/TakeoutSaaS.Shared.Abstractions/Diagnostics/TraceContext.cs index ad8aa43..ae8284b 100644 --- a/src/Core/TakeoutSaaS.Shared.Abstractions/Diagnostics/TraceContext.cs +++ b/src/Core/TakeoutSaaS.Shared.Abstractions/Diagnostics/TraceContext.cs @@ -1,5 +1,3 @@ -using System.Threading; - namespace TakeoutSaaS.Shared.Abstractions.Diagnostics; /// diff --git a/src/Core/TakeoutSaaS.Shared.Abstractions/Exceptions/ValidationException.cs b/src/Core/TakeoutSaaS.Shared.Abstractions/Exceptions/ValidationException.cs index a87def6..f95bf0b 100644 --- a/src/Core/TakeoutSaaS.Shared.Abstractions/Exceptions/ValidationException.cs +++ b/src/Core/TakeoutSaaS.Shared.Abstractions/Exceptions/ValidationException.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - namespace TakeoutSaaS.Shared.Abstractions.Exceptions; /// diff --git a/src/Core/TakeoutSaaS.Shared.Abstractions/Results/ApiResponse.NonGeneric.cs b/src/Core/TakeoutSaaS.Shared.Abstractions/Results/ApiResponse.NonGeneric.cs index d3e8d6d..04f400c 100644 --- a/src/Core/TakeoutSaaS.Shared.Abstractions/Results/ApiResponse.NonGeneric.cs +++ b/src/Core/TakeoutSaaS.Shared.Abstractions/Results/ApiResponse.NonGeneric.cs @@ -8,24 +8,36 @@ public static class ApiResponse /// /// 仅返回成功消息(无数据)。 /// + /// 提示信息。 + /// 封装后的成功响应。 public static ApiResponse Success(string? message = "操作成功") => ApiResponse.Ok(message: message); /// /// 成功且携带数据。 /// + /// 业务数据。 + /// 提示信息。 + /// 封装后的成功响应。 public static ApiResponse Ok(object? data, string? message = "操作成功") => data is null ? ApiResponse.Ok(message: message) : ApiResponse.Ok(data, message); /// /// 错误返回。 /// + /// 错误码。 + /// 错误提示。 + /// 封装后的失败响应。 public static ApiResponse Failure(int code, string message) => ApiResponse.Error(code, message); /// /// 错误返回(附带详情)。 /// + /// 错误码。 + /// 错误提示。 + /// 错误详情。 + /// 封装后的失败响应。 public static ApiResponse Error(int code, string message, object? errors = null) => ApiResponse.Error(code, message, errors); } diff --git a/src/Core/TakeoutSaaS.Shared.Abstractions/Results/ApiResponse.cs b/src/Core/TakeoutSaaS.Shared.Abstractions/Results/ApiResponse.cs index 62365b3..f89a1b7 100644 --- a/src/Core/TakeoutSaaS.Shared.Abstractions/Results/ApiResponse.cs +++ b/src/Core/TakeoutSaaS.Shared.Abstractions/Results/ApiResponse.cs @@ -47,36 +47,53 @@ public sealed record ApiResponse /// /// 成功返回。 /// + /// 业务数据。 + /// 提示信息。 + /// 封装后的成功响应。 public static ApiResponse Ok(T data, string? message = "操作成功") => Create(true, 200, message, data); /// /// 无数据的成功返回。 /// + /// 提示信息。 + /// 封装后的成功响应。 public static ApiResponse Ok(string? message = "操作成功") => Create(true, 200, message, default); /// /// 兼容旧名称:成功结果。 /// + /// 业务数据。 + /// 提示信息。 + /// 封装后的成功响应。 public static ApiResponse SuccessResult(T data, string? message = "操作成功") => Ok(data, message); /// /// 错误返回。 /// + /// 错误码。 + /// 错误提示。 + /// 错误详情。 + /// 封装后的失败响应。 public static ApiResponse Error(int code, string message, object? errors = null) => Create(false, code, message, default, errors); /// /// 兼容旧名称:失败结果。 /// + /// 错误码。 + /// 错误提示。 + /// 封装后的失败响应。 public static ApiResponse Failure(int code, string message) => Error(code, message); /// /// 附加错误详情。 /// + /// 错误详情。 + /// 包含错误详情的新响应。 public ApiResponse WithErrors(object? errors) => this with { Errors = errors }; @@ -95,6 +112,7 @@ public sealed record ApiResponse /// /// 解析当前 TraceId。 /// + /// 当前有效的 TraceId。 private static string ResolveTraceId() { if (!string.IsNullOrWhiteSpace(TraceContext.TraceId)) @@ -142,6 +160,7 @@ internal sealed class IdFallbackGenerator /// /// 生成雪花风格的本地备用 ID。 /// + /// 本地生成的雪花 ID。 public long NextId() { lock (_sync) @@ -168,6 +187,8 @@ internal sealed class IdFallbackGenerator /// /// 等待到下一个毫秒以避免序列冲突。 /// + /// 上一毫秒的时间戳。 + /// 下一个时间戳(毫秒)。 private static long WaitNextMillis(long lastTimestamp) { var timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); diff --git a/src/Core/TakeoutSaaS.Shared.Abstractions/Results/PagedResult.cs b/src/Core/TakeoutSaaS.Shared.Abstractions/Results/PagedResult.cs index 69c5ba4..4bc4c7e 100644 --- a/src/Core/TakeoutSaaS.Shared.Abstractions/Results/PagedResult.cs +++ b/src/Core/TakeoutSaaS.Shared.Abstractions/Results/PagedResult.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace TakeoutSaaS.Shared.Abstractions.Results; /// diff --git a/src/Core/TakeoutSaaS.Shared.Abstractions/Tenancy/ITenantProvider.cs b/src/Core/TakeoutSaaS.Shared.Abstractions/Tenancy/ITenantProvider.cs index 02c818a..76358db 100644 --- a/src/Core/TakeoutSaaS.Shared.Abstractions/Tenancy/ITenantProvider.cs +++ b/src/Core/TakeoutSaaS.Shared.Abstractions/Tenancy/ITenantProvider.cs @@ -6,7 +6,8 @@ namespace TakeoutSaaS.Shared.Abstractions.Tenancy; public interface ITenantProvider { /// - /// 获取当前租户 ID,未解析时返回 Guid.Empty。 + /// 获取当前租户 ID,未解析时返回 0。 /// + /// 当前请求绑定的租户 ID,未解析时为 0。 long GetCurrentTenantId(); } diff --git a/src/Core/TakeoutSaaS.Shared.Kernel/Ids/SnowflakeIdGenerator.cs b/src/Core/TakeoutSaaS.Shared.Kernel/Ids/SnowflakeIdGenerator.cs index 06d22fb..862edb9 100644 --- a/src/Core/TakeoutSaaS.Shared.Kernel/Ids/SnowflakeIdGenerator.cs +++ b/src/Core/TakeoutSaaS.Shared.Kernel/Ids/SnowflakeIdGenerator.cs @@ -1,6 +1,5 @@ using System.Diagnostics; using System.Security.Cryptography; -using System.Threading; using TakeoutSaaS.Shared.Abstractions.Ids; namespace TakeoutSaaS.Shared.Kernel.Ids; diff --git a/src/Core/TakeoutSaaS.Shared.Web/Extensions/ServiceCollectionExtensions.cs b/src/Core/TakeoutSaaS.Shared.Web/Extensions/ServiceCollectionExtensions.cs index dd5f1e3..7ac65ce 100644 --- a/src/Core/TakeoutSaaS.Shared.Web/Extensions/ServiceCollectionExtensions.cs +++ b/src/Core/TakeoutSaaS.Shared.Web/Extensions/ServiceCollectionExtensions.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.Extensions.DependencyInjection; using TakeoutSaaS.Shared.Abstractions.Security; using TakeoutSaaS.Shared.Web.Filters; diff --git a/src/Core/TakeoutSaaS.Shared.Web/Filters/ValidateModelAttribute.cs b/src/Core/TakeoutSaaS.Shared.Web/Filters/ValidateModelAttribute.cs index 4c802e0..c6ad12f 100644 --- a/src/Core/TakeoutSaaS.Shared.Web/Filters/ValidateModelAttribute.cs +++ b/src/Core/TakeoutSaaS.Shared.Web/Filters/ValidateModelAttribute.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using TakeoutSaaS.Shared.Abstractions.Constants; diff --git a/src/Core/TakeoutSaaS.Shared.Web/Middleware/CorrelationIdMiddleware.cs b/src/Core/TakeoutSaaS.Shared.Web/Middleware/CorrelationIdMiddleware.cs index e1dadd9..eb7d0a9 100644 --- a/src/Core/TakeoutSaaS.Shared.Web/Middleware/CorrelationIdMiddleware.cs +++ b/src/Core/TakeoutSaaS.Shared.Web/Middleware/CorrelationIdMiddleware.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; +using System.Diagnostics; using TakeoutSaaS.Shared.Abstractions.Diagnostics; using TakeoutSaaS.Shared.Abstractions.Ids; @@ -49,10 +46,10 @@ public sealed class CorrelationIdMiddleware(RequestDelegate next, ILogger - { - ["TraceId"] = traceId, - ["SpanId"] = spanId - })) + { + ["TraceId"] = traceId, + ["SpanId"] = spanId + })) { try { diff --git a/src/Core/TakeoutSaaS.Shared.Web/Middleware/ExceptionHandlingMiddleware.cs b/src/Core/TakeoutSaaS.Shared.Web/Middleware/ExceptionHandlingMiddleware.cs index 2babea2..c52d364 100644 --- a/src/Core/TakeoutSaaS.Shared.Web/Middleware/ExceptionHandlingMiddleware.cs +++ b/src/Core/TakeoutSaaS.Shared.Web/Middleware/ExceptionHandlingMiddleware.cs @@ -1,10 +1,8 @@ -using System; -using System.Text.Json; -using System.Text.Json.Serialization; -using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; +using System.Text.Json; +using System.Text.Json.Serialization; using TakeoutSaaS.Shared.Abstractions.Constants; using TakeoutSaaS.Shared.Abstractions.Exceptions; using TakeoutSaaS.Shared.Abstractions.Results; diff --git a/src/Core/TakeoutSaaS.Shared.Web/Middleware/RequestLoggingMiddleware.cs b/src/Core/TakeoutSaaS.Shared.Web/Middleware/RequestLoggingMiddleware.cs index 9ec3592..7162688 100644 --- a/src/Core/TakeoutSaaS.Shared.Web/Middleware/RequestLoggingMiddleware.cs +++ b/src/Core/TakeoutSaaS.Shared.Web/Middleware/RequestLoggingMiddleware.cs @@ -1,7 +1,6 @@ -using System.Diagnostics; -using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; +using System.Diagnostics; using TakeoutSaaS.Shared.Abstractions.Diagnostics; namespace TakeoutSaaS.Shared.Web.Middleware; diff --git a/src/Core/TakeoutSaaS.Shared.Web/Security/ClaimsPrincipalExtensions.cs b/src/Core/TakeoutSaaS.Shared.Web/Security/ClaimsPrincipalExtensions.cs index 05a90b2..630789b 100644 --- a/src/Core/TakeoutSaaS.Shared.Web/Security/ClaimsPrincipalExtensions.cs +++ b/src/Core/TakeoutSaaS.Shared.Web/Security/ClaimsPrincipalExtensions.cs @@ -1,4 +1,3 @@ -using System; using System.Security.Claims; namespace TakeoutSaaS.Shared.Web.Security; diff --git a/src/Core/TakeoutSaaS.Shared.Web/Security/HttpContextCurrentUserAccessor.cs b/src/Core/TakeoutSaaS.Shared.Web/Security/HttpContextCurrentUserAccessor.cs index 3d5c423..bc43ea8 100644 --- a/src/Core/TakeoutSaaS.Shared.Web/Security/HttpContextCurrentUserAccessor.cs +++ b/src/Core/TakeoutSaaS.Shared.Web/Security/HttpContextCurrentUserAccessor.cs @@ -1,5 +1,5 @@ -using System.Security.Claims; using Microsoft.AspNetCore.Http; +using System.Security.Claims; using TakeoutSaaS.Shared.Abstractions.Security; namespace TakeoutSaaS.Shared.Web.Security; diff --git a/src/Core/TakeoutSaaS.Shared.Web/Swagger/ConfigureSwaggerOptions.cs b/src/Core/TakeoutSaaS.Shared.Web/Swagger/ConfigureSwaggerOptions.cs index e167f00..68590fc 100644 --- a/src/Core/TakeoutSaaS.Shared.Web/Swagger/ConfigureSwaggerOptions.cs +++ b/src/Core/TakeoutSaaS.Shared.Web/Swagger/ConfigureSwaggerOptions.cs @@ -1,6 +1,4 @@ -using System; -using Microsoft.AspNetCore.Mvc.ApiExplorer; -using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Microsoft.OpenApi; diff --git a/src/Domain/TakeoutSaaS.Domain/Deliveries/Repositories/IDeliveryRepository.cs b/src/Domain/TakeoutSaaS.Domain/Deliveries/Repositories/IDeliveryRepository.cs index 27d5c95..f97f67e 100644 --- a/src/Domain/TakeoutSaaS.Domain/Deliveries/Repositories/IDeliveryRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Deliveries/Repositories/IDeliveryRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Deliveries.Entities; using TakeoutSaaS.Domain.Deliveries.Enums; @@ -14,45 +11,77 @@ public interface IDeliveryRepository /// /// 依据标识获取配送单。 /// + /// 配送单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 配送单实体或 null。 Task FindByIdAsync(long deliveryOrderId, long tenantId, CancellationToken cancellationToken = default); /// /// 依据订单标识获取配送单。 /// + /// 订单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 配送单实体或 null。 Task FindByOrderIdAsync(long orderId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取配送事件轨迹。 /// + /// 配送单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 配送事件列表。 Task> GetEventsAsync(long deliveryOrderId, long tenantId, CancellationToken cancellationToken = default); /// /// 新增配送单。 /// + /// 配送单实体。 + /// 取消标记。 + /// 异步任务。 Task AddDeliveryOrderAsync(DeliveryOrder deliveryOrder, CancellationToken cancellationToken = default); /// /// 新增配送事件。 /// + /// 配送事件。 + /// 取消标记。 + /// 异步任务。 Task AddEventAsync(DeliveryEvent deliveryEvent, CancellationToken cancellationToken = default); /// /// 持久化变更。 /// + /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); /// /// 按状态查询配送单。 /// + /// 租户 ID。 + /// 配送状态。 + /// 订单 ID。 + /// 取消标记。 + /// 配送单列表。 Task> SearchAsync(long tenantId, DeliveryStatus? status, long? orderId, CancellationToken cancellationToken = default); /// /// 更新配送单。 /// + /// 配送单实体。 + /// 取消标记。 + /// 异步任务。 Task UpdateDeliveryOrderAsync(DeliveryOrder deliveryOrder, CancellationToken cancellationToken = default); /// /// 删除配送单及事件。 /// + /// 配送单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task DeleteDeliveryOrderAsync(long deliveryOrderId, long tenantId, CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Dictionary/Entities/DictionaryGroup.cs b/src/Domain/TakeoutSaaS.Domain/Dictionary/Entities/DictionaryGroup.cs index 68694b0..bf48fca 100644 --- a/src/Domain/TakeoutSaaS.Domain/Dictionary/Entities/DictionaryGroup.cs +++ b/src/Domain/TakeoutSaaS.Domain/Dictionary/Entities/DictionaryGroup.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using TakeoutSaaS.Domain.Dictionary.Enums; using TakeoutSaaS.Shared.Abstractions.Entities; diff --git a/src/Domain/TakeoutSaaS.Domain/Dictionary/Repositories/IDictionaryRepository.cs b/src/Domain/TakeoutSaaS.Domain/Dictionary/Repositories/IDictionaryRepository.cs index 9a9b427..d0d4294 100644 --- a/src/Domain/TakeoutSaaS.Domain/Dictionary/Repositories/IDictionaryRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Dictionary/Repositories/IDictionaryRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Dictionary.Entities; using TakeoutSaaS.Domain.Dictionary.Enums; @@ -14,55 +11,89 @@ public interface IDictionaryRepository /// /// 依据 ID 获取分组。 /// + /// 分组 ID。 + /// 取消标记。 + /// 分组实体或 null。 Task FindGroupByIdAsync(long id, CancellationToken cancellationToken = default); /// /// 依据编码获取分组。 /// + /// 分组编码。 + /// 取消标记。 + /// 分组实体或 null。 Task FindGroupByCodeAsync(string code, CancellationToken cancellationToken = default); /// /// 搜索分组,可按作用域过滤。 /// + /// 作用域。 + /// 取消标记。 + /// 分组集合。 Task> SearchGroupsAsync(DictionaryScope? scope, CancellationToken cancellationToken = default); /// /// 新增分组。 /// + /// 分组实体。 + /// 取消标记。 + /// 异步任务。 Task AddGroupAsync(DictionaryGroup group, CancellationToken cancellationToken = default); /// /// 删除分组。 /// + /// 分组实体。 + /// 取消标记。 + /// 异步任务。 Task RemoveGroupAsync(DictionaryGroup group, CancellationToken cancellationToken = default); /// /// 依据 ID 获取字典项。 /// + /// 字典项 ID。 + /// 取消标记。 + /// 字典项或 null。 Task FindItemByIdAsync(long id, CancellationToken cancellationToken = default); /// /// 获取某分组下的所有字典项。 /// + /// 分组 ID。 + /// 取消标记。 + /// 字典项集合。 Task> GetItemsByGroupIdAsync(long groupId, CancellationToken cancellationToken = default); /// /// 按分组编码集合获取字典项(可包含系统参数)。 /// + /// 分组编码集合。 + /// 租户 ID。 + /// 是否包含系统分组。 + /// 取消标记。 + /// 字典项集合。 Task> GetItemsByCodesAsync(IEnumerable codes, long tenantId, bool includeSystem, CancellationToken cancellationToken = default); /// /// 新增字典项。 /// + /// 字典项实体。 + /// 取消标记。 + /// 异步任务。 Task AddItemAsync(DictionaryItem item, CancellationToken cancellationToken = default); /// /// 删除字典项。 /// + /// 字典项实体。 + /// 取消标记。 + /// 异步任务。 Task RemoveItemAsync(DictionaryItem item, CancellationToken cancellationToken = default); /// /// 持久化更改。 /// + /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IIdentityUserRepository.cs b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IIdentityUserRepository.cs index 5b809cf..cc3a497 100644 --- a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IIdentityUserRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IIdentityUserRepository.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Identity.Entities; namespace TakeoutSaaS.Domain.Identity.Repositories; @@ -14,11 +10,17 @@ public interface IIdentityUserRepository /// /// 根据账号获取后台用户。 /// + /// 账号。 + /// 取消标记。 + /// 后台用户或 null。 Task FindByAccountAsync(string account, CancellationToken cancellationToken = default); /// /// 根据 ID 获取后台用户。 /// + /// 用户 ID。 + /// 取消标记。 + /// 后台用户或 null。 Task FindByIdAsync(long userId, CancellationToken cancellationToken = default); /// @@ -27,10 +29,15 @@ public interface IIdentityUserRepository /// 租户 ID。 /// 可选关键字(账号/名称)。 /// 取消标记。 + /// 后台用户列表。 Task> SearchAsync(long tenantId, string? keyword, CancellationToken cancellationToken = default); /// /// 获取指定租户、用户集合对应的用户(只读)。 /// + /// 租户 ID。 + /// 用户 ID 集合。 + /// 取消标记。 + /// 后台用户列表。 Task> GetByIdsAsync(long tenantId, IEnumerable userIds, CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IPermissionRepository.cs b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IPermissionRepository.cs index b6e7833..d643394 100644 --- a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IPermissionRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IPermissionRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Identity.Entities; namespace TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRolePermissionRepository.cs b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRolePermissionRepository.cs index 3f45d5c..4502d1e 100644 --- a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRolePermissionRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRolePermissionRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Identity.Entities; namespace TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRoleRepository.cs b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRoleRepository.cs index f740fce..726a513 100644 --- a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRoleRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRoleRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Identity.Entities; namespace TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRoleTemplateRepository.cs b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRoleTemplateRepository.cs index 3a9ce61..f175722 100644 --- a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRoleTemplateRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IRoleTemplateRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Identity.Entities; namespace TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IUserRoleRepository.cs b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IUserRoleRepository.cs index 68c0915..6759d08 100644 --- a/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IUserRoleRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Identity/Repositories/IUserRoleRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Identity.Entities; namespace TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Domain/TakeoutSaaS.Domain/Merchants/Repositories/IMerchantCategoryRepository.cs b/src/Domain/TakeoutSaaS.Domain/Merchants/Repositories/IMerchantCategoryRepository.cs index f8669d6..cabdd80 100644 --- a/src/Domain/TakeoutSaaS.Domain/Merchants/Repositories/IMerchantCategoryRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Merchants/Repositories/IMerchantCategoryRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Merchants.Entities; namespace TakeoutSaaS.Domain.Merchants.Repositories; @@ -13,35 +10,57 @@ public interface IMerchantCategoryRepository /// /// 列出当前租户的类目。 /// + /// 租户 ID。 + /// 取消标记。 + /// 类目列表。 Task> ListAsync(long tenantId, CancellationToken cancellationToken = default); /// /// 是否存在同名类目。 /// + /// 类目名称。 + /// 租户 ID。 + /// 取消标记。 + /// 存在返回 true。 Task ExistsAsync(string name, long tenantId, CancellationToken cancellationToken = default); /// /// 查找类目。 /// + /// 类目 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 类目实体或 null。 Task FindByIdAsync(long id, long tenantId, CancellationToken cancellationToken = default); /// /// 新增类目。 /// + /// 类目实体。 + /// 取消标记。 + /// 异步任务。 Task AddAsync(MerchantCategory category, CancellationToken cancellationToken = default); /// /// 删除类目。 /// + /// 类目实体。 + /// 取消标记。 + /// 异步任务。 Task RemoveAsync(MerchantCategory category, CancellationToken cancellationToken = default); /// /// 批量更新类目信息。 /// + /// 类目集合。 + /// 取消标记。 + /// 异步任务。 Task UpdateRangeAsync(IEnumerable categories, CancellationToken cancellationToken = default); /// /// 持久化更改。 /// + /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Merchants/Repositories/IMerchantRepository.cs b/src/Domain/TakeoutSaaS.Domain/Merchants/Repositories/IMerchantRepository.cs index 3a7df9b..1e1ee19 100644 --- a/src/Domain/TakeoutSaaS.Domain/Merchants/Repositories/IMerchantRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Merchants/Repositories/IMerchantRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Merchants.Entities; using TakeoutSaaS.Domain.Merchants.Enums; @@ -14,21 +11,37 @@ public interface IMerchantRepository /// /// 依据标识获取商户。 /// + /// 商户 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 商户实体或 null。 Task FindByIdAsync(long merchantId, long tenantId, CancellationToken cancellationToken = default); /// /// 按状态筛选商户列表。 /// + /// 租户 ID。 + /// 状态过滤。 + /// 取消标记。 + /// 商户集合。 Task> SearchAsync(long tenantId, MerchantStatus? status, CancellationToken cancellationToken = default); /// /// 获取指定商户的员工列表。 /// + /// 商户 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 员工集合。 Task> GetStaffAsync(long merchantId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取指定商户的合同列表。 /// + /// 商户 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 合同集合。 Task> GetContractsAsync(long merchantId, long tenantId, CancellationToken cancellationToken = default); /// @@ -44,6 +57,10 @@ public interface IMerchantRepository /// /// 获取指定商户的资质文件列表。 /// + /// 商户 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 资质文件列表。 Task> GetDocumentsAsync(long merchantId, long tenantId, CancellationToken cancellationToken = default); /// @@ -59,16 +76,25 @@ public interface IMerchantRepository /// /// 新增商户主体。 /// + /// 商户实体。 + /// 取消标记。 + /// 异步任务。 Task AddMerchantAsync(Merchant merchant, CancellationToken cancellationToken = default); /// /// 新增商户员工。 /// + /// 员工实体。 + /// 取消标记。 + /// 异步任务。 Task AddStaffAsync(MerchantStaff staff, CancellationToken cancellationToken = default); /// /// 新增商户合同。 /// + /// 合同实体。 + /// 取消标记。 + /// 异步任务。 Task AddContractAsync(MerchantContract contract, CancellationToken cancellationToken = default); /// @@ -82,6 +108,9 @@ public interface IMerchantRepository /// /// 新增商户资质文件。 /// + /// 资质文件实体。 + /// 取消标记。 + /// 异步任务。 Task AddDocumentAsync(MerchantDocument document, CancellationToken cancellationToken = default); /// @@ -95,25 +124,41 @@ public interface IMerchantRepository /// /// 持久化变更。 /// + /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); /// /// 更新商户信息。 /// + /// 商户实体。 + /// 取消标记。 + /// 异步任务。 Task UpdateMerchantAsync(Merchant merchant, CancellationToken cancellationToken = default); /// /// 删除商户。 /// + /// 商户 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task DeleteMerchantAsync(long merchantId, long tenantId, CancellationToken cancellationToken = default); /// /// 记录审核日志。 /// + /// 审核日志实体。 + /// 取消标记。 + /// 异步任务。 Task AddAuditLogAsync(MerchantAuditLog log, CancellationToken cancellationToken = default); /// /// 获取审核日志。 /// + /// 商户 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 审核日志列表。 Task> GetAuditLogsAsync(long merchantId, long tenantId, CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Orders/Repositories/IOrderRepository.cs b/src/Domain/TakeoutSaaS.Domain/Orders/Repositories/IOrderRepository.cs index d48ecf3..96a3bd6 100644 --- a/src/Domain/TakeoutSaaS.Domain/Orders/Repositories/IOrderRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Orders/Repositories/IOrderRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Orders.Entities; using TakeoutSaaS.Domain.Orders.Enums; using TakeoutSaaS.Domain.Payments.Enums; @@ -15,65 +12,111 @@ public interface IOrderRepository /// /// 依据标识获取订单。 /// + /// 订单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 订单实体或 null。 Task FindByIdAsync(long orderId, long tenantId, CancellationToken cancellationToken = default); /// /// 依据订单号获取订单。 /// + /// 订单号。 + /// 租户 ID。 + /// 取消标记。 + /// 订单实体或 null。 Task FindByOrderNoAsync(string orderNo, long tenantId, CancellationToken cancellationToken = default); /// /// 按状态筛选订单列表。 /// + /// 租户 ID。 + /// 订单状态。 + /// 支付状态。 + /// 取消标记。 + /// 订单集合。 Task> SearchAsync(long tenantId, OrderStatus? status, PaymentStatus? paymentStatus, CancellationToken cancellationToken = default); /// /// 获取订单明细行。 /// + /// 订单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 订单明细集合。 Task> GetItemsAsync(long orderId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取订单状态流转记录。 /// + /// 订单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 状态变更记录列表。 Task> GetStatusHistoryAsync(long orderId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取订单退款申请。 /// + /// 订单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 退款申请列表。 Task> GetRefundsAsync(long orderId, long tenantId, CancellationToken cancellationToken = default); /// /// 新增订单。 /// + /// 订单实体。 + /// 取消标记。 + /// 异步任务。 Task AddOrderAsync(Order order, CancellationToken cancellationToken = default); /// /// 新增订单明细。 /// + /// 明细集合。 + /// 取消标记。 + /// 异步任务。 Task AddItemsAsync(IEnumerable items, CancellationToken cancellationToken = default); /// /// 新增订单状态记录。 /// + /// 状态记录。 + /// 取消标记。 + /// 异步任务。 Task AddStatusHistoryAsync(OrderStatusHistory history, CancellationToken cancellationToken = default); /// /// 新增退款申请。 /// + /// 退款申请实体。 + /// 取消标记。 + /// 异步任务。 Task AddRefundAsync(RefundRequest refund, CancellationToken cancellationToken = default); /// /// 持久化变更。 /// + /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); /// /// 更新订单。 /// + /// 订单实体。 + /// 取消标记。 + /// 异步任务。 Task UpdateOrderAsync(Order order, CancellationToken cancellationToken = default); /// /// 删除订单。 /// + /// 订单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task DeleteOrderAsync(long orderId, long tenantId, CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Payments/Repositories/IPaymentRepository.cs b/src/Domain/TakeoutSaaS.Domain/Payments/Repositories/IPaymentRepository.cs index f12c937..7983a5a 100644 --- a/src/Domain/TakeoutSaaS.Domain/Payments/Repositories/IPaymentRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Payments/Repositories/IPaymentRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Payments.Entities; using TakeoutSaaS.Domain.Payments.Enums; @@ -14,45 +11,76 @@ public interface IPaymentRepository /// /// 依据标识获取支付记录。 /// + /// 支付记录 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 支付记录或 null。 Task FindByIdAsync(long paymentId, long tenantId, CancellationToken cancellationToken = default); /// /// 依据订单标识获取支付记录。 /// + /// 订单 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 支付记录或 null。 Task FindByOrderIdAsync(long orderId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取支付对应的退款记录。 /// + /// 支付记录 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 退款记录列表。 Task> GetRefundsAsync(long paymentId, long tenantId, CancellationToken cancellationToken = default); /// /// 新增支付记录。 /// + /// 支付实体。 + /// 取消标记。 + /// 异步任务。 Task AddPaymentAsync(PaymentRecord payment, CancellationToken cancellationToken = default); /// /// 新增退款记录。 /// + /// 退款实体。 + /// 取消标记。 + /// 异步任务。 Task AddRefundAsync(PaymentRefundRecord refund, CancellationToken cancellationToken = default); /// /// 持久化变更。 /// + /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); /// /// 按状态筛选支付记录。 /// + /// 租户 ID。 + /// 支付状态。 + /// 取消标记。 + /// 支付记录列表。 Task> SearchAsync(long tenantId, PaymentStatus? status, CancellationToken cancellationToken = default); /// /// 更新支付记录。 /// + /// 支付实体。 + /// 取消标记。 + /// 异步任务。 Task UpdatePaymentAsync(PaymentRecord payment, CancellationToken cancellationToken = default); /// /// 删除支付记录及关联退款。 /// + /// 支付记录 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task DeletePaymentAsync(long paymentId, long tenantId, CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Products/Repositories/IProductRepository.cs b/src/Domain/TakeoutSaaS.Domain/Products/Repositories/IProductRepository.cs index 6f01804..1cc8155 100644 --- a/src/Domain/TakeoutSaaS.Domain/Products/Repositories/IProductRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Products/Repositories/IProductRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Products.Entities; using TakeoutSaaS.Domain.Products.Enums; @@ -14,135 +11,234 @@ public interface IProductRepository /// /// 依据标识获取商品。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 商品实体或 null。 Task FindByIdAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 按分类与状态筛选商品列表。 /// + /// 租户 ID。 + /// 分类 ID。 + /// 商品状态。 + /// 取消标记。 + /// 商品集合。 Task> SearchAsync(long tenantId, long? categoryId, ProductStatus? status, CancellationToken cancellationToken = default); /// /// 获取租户下的商品分类。 /// + /// 租户 ID。 + /// 取消标记。 + /// 分类集合。 Task> GetCategoriesAsync(long tenantId, CancellationToken cancellationToken = default); /// /// 获取商品 SKU。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// SKU 集合。 Task> GetSkusAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取商品加料组与选项。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 加料组集合。 Task> GetAddonGroupsAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取商品加料选项。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 加料选项集合。 Task> GetAddonOptionsAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取商品规格组与选项。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 规格组集合。 Task> GetAttributeGroupsAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取商品规格选项。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 规格选项集合。 Task> GetAttributeOptionsAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取商品媒资。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 媒资列表。 Task> GetMediaAssetsAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取商品定价规则。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 定价规则集合。 Task> GetPricingRulesAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 新增分类。 /// + /// 分类实体。 + /// 取消标记。 + /// 异步任务。 Task AddCategoryAsync(ProductCategory category, CancellationToken cancellationToken = default); /// /// 新增商品。 /// + /// 商品实体。 + /// 取消标记。 + /// 异步任务。 Task AddProductAsync(Product product, CancellationToken cancellationToken = default); /// /// 新增 SKU。 /// + /// SKU 集合。 + /// 取消标记。 + /// 异步任务。 Task AddSkusAsync(IEnumerable skus, CancellationToken cancellationToken = default); /// /// 新增加料组与选项。 /// + /// 加料组集合。 + /// 加料选项集合。 + /// 取消标记。 + /// 异步任务。 Task AddAddonGroupsAsync(IEnumerable groups, IEnumerable options, CancellationToken cancellationToken = default); /// /// 新增规格组与选项。 /// + /// 规格组集合。 + /// 规格选项集合。 + /// 取消标记。 + /// 异步任务。 Task AddAttributeGroupsAsync(IEnumerable groups, IEnumerable options, CancellationToken cancellationToken = default); /// /// 新增媒资。 /// + /// 媒资集合。 + /// 取消标记。 + /// 异步任务。 Task AddMediaAssetsAsync(IEnumerable assets, CancellationToken cancellationToken = default); /// /// 新增定价规则。 /// + /// 定价规则集合。 + /// 取消标记。 + /// 异步任务。 Task AddPricingRulesAsync(IEnumerable rules, CancellationToken cancellationToken = default); /// /// 持久化变更。 /// + /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); /// /// 更新商品。 /// + /// 商品实体。 + /// 取消标记。 + /// 异步任务。 Task UpdateProductAsync(Product product, CancellationToken cancellationToken = default); /// /// 删除商品。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task DeleteProductAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 更新分类。 /// + /// 分类实体。 + /// 取消标记。 + /// 异步任务。 Task UpdateCategoryAsync(ProductCategory category, CancellationToken cancellationToken = default); /// /// 删除分类。 /// + /// 分类 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task DeleteCategoryAsync(long categoryId, long tenantId, CancellationToken cancellationToken = default); /// /// 删除商品下的 SKU。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task RemoveSkusAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 删除商品下的加料组及选项。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task RemoveAddonGroupsAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 删除商品下的规格组及选项。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task RemoveAttributeGroupsAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 删除商品媒资。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task RemoveMediaAssetsAsync(long productId, long tenantId, CancellationToken cancellationToken = default); /// /// 删除商品定价规则。 /// + /// 商品 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task RemovePricingRulesAsync(long productId, long tenantId, CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Stores/Repositories/IStoreRepository.cs b/src/Domain/TakeoutSaaS.Domain/Stores/Repositories/IStoreRepository.cs index bbbf7e0..c7ecd4a 100644 --- a/src/Domain/TakeoutSaaS.Domain/Stores/Repositories/IStoreRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Stores/Repositories/IStoreRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Stores.Entities; using TakeoutSaaS.Domain.Stores.Enums; @@ -14,90 +11,152 @@ public interface IStoreRepository /// /// 依据标识获取门店。 /// + /// 门店 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 门店实体或 null。 Task FindByIdAsync(long storeId, long tenantId, CancellationToken cancellationToken = default); /// /// 按租户筛选门店列表。 /// + /// 租户 ID。 + /// 状态过滤。 + /// 取消标记。 + /// 门店集合。 Task> SearchAsync(long tenantId, StoreStatus? status, CancellationToken cancellationToken = default); /// /// 获取门店营业时段。 /// + /// 门店 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 营业时段列表。 Task> GetBusinessHoursAsync(long storeId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取门店配送区域配置。 /// + /// 门店 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 配送区域列表。 Task> GetDeliveryZonesAsync(long storeId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取门店节假日配置。 /// + /// 门店 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 节假日配置列表。 Task> GetHolidaysAsync(long storeId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取门店桌台区域。 /// + /// 门店 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 桌台区域列表。 Task> GetTableAreasAsync(long storeId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取门店桌台列表。 /// + /// 门店 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 桌台列表。 Task> GetTablesAsync(long storeId, long tenantId, CancellationToken cancellationToken = default); /// /// 获取门店员工排班。 /// + /// 门店 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 排班列表。 Task> GetShiftsAsync(long storeId, long tenantId, CancellationToken cancellationToken = default); /// /// 新增门店。 /// + /// 门店实体。 + /// 取消标记。 + /// 异步任务。 Task AddStoreAsync(Store store, CancellationToken cancellationToken = default); /// /// 新增营业时段。 /// + /// 营业时段集合。 + /// 取消标记。 + /// 异步任务。 Task AddBusinessHoursAsync(IEnumerable hours, CancellationToken cancellationToken = default); /// /// 新增配送区域。 /// + /// 配送区域集合。 + /// 取消标记。 + /// 异步任务。 Task AddDeliveryZonesAsync(IEnumerable zones, CancellationToken cancellationToken = default); /// /// 新增节假日配置。 /// + /// 节假日集合。 + /// 取消标记。 + /// 异步任务。 Task AddHolidaysAsync(IEnumerable holidays, CancellationToken cancellationToken = default); /// /// 新增桌台区域。 /// + /// 桌台区域集合。 + /// 取消标记。 + /// 异步任务。 Task AddTableAreasAsync(IEnumerable areas, CancellationToken cancellationToken = default); /// /// 新增桌台。 /// + /// 桌台集合。 + /// 取消标记。 + /// 异步任务。 Task AddTablesAsync(IEnumerable tables, CancellationToken cancellationToken = default); /// /// 新增排班。 /// + /// 排班集合。 + /// 取消标记。 + /// 异步任务。 Task AddShiftsAsync(IEnumerable shifts, CancellationToken cancellationToken = default); /// /// 持久化变更。 /// + /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); /// /// 更新门店。 /// + /// 门店实体。 + /// 取消标记。 + /// 异步任务。 Task UpdateStoreAsync(Store store, CancellationToken cancellationToken = default); /// /// 删除门店。 /// + /// 门店 ID。 + /// 租户 ID。 + /// 取消标记。 + /// 异步任务。 Task DeleteStoreAsync(long storeId, long tenantId, CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/SystemParameters/Repositories/ISystemParameterRepository.cs b/src/Domain/TakeoutSaaS.Domain/SystemParameters/Repositories/ISystemParameterRepository.cs index c222342..ced9e53 100644 --- a/src/Domain/TakeoutSaaS.Domain/SystemParameters/Repositories/ISystemParameterRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/SystemParameters/Repositories/ISystemParameterRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.SystemParameters.Entities; namespace TakeoutSaaS.Domain.SystemParameters.Repositories; @@ -13,35 +10,56 @@ public interface ISystemParameterRepository /// /// 根据标识获取系统参数。 /// + /// 参数 ID。 + /// 取消标记。 + /// 系统参数或 null。 Task FindByIdAsync(long id, CancellationToken cancellationToken = default); /// /// 根据键获取系统参数(当前租户)。 /// + /// 参数键。 + /// 取消标记。 + /// 系统参数或 null。 Task FindByKeyAsync(string key, CancellationToken cancellationToken = default); /// /// 查询系统参数列表。 /// + /// 关键字。 + /// 启用状态。 + /// 取消标记。 + /// 参数列表。 Task> SearchAsync(string? keyword, bool? isEnabled, CancellationToken cancellationToken = default); /// /// 新增系统参数。 /// + /// 参数实体。 + /// 取消标记。 + /// 异步任务。 Task AddAsync(SystemParameter parameter, CancellationToken cancellationToken = default); /// /// 删除系统参数。 /// + /// 参数实体。 + /// 取消标记。 + /// 异步任务。 Task RemoveAsync(SystemParameter parameter, CancellationToken cancellationToken = default); /// /// 更新系统参数。 /// + /// 参数实体。 + /// 取消标记。 + /// 异步任务。 Task UpdateAsync(SystemParameter parameter, CancellationToken cancellationToken = default); /// /// 持久化更改。 /// + /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantAnnouncementReadRepository.cs b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantAnnouncementReadRepository.cs index ac76bc8..53af993 100644 --- a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantAnnouncementReadRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantAnnouncementReadRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Tenants.Entities; namespace TakeoutSaaS.Domain.Tenants.Repositories; @@ -44,11 +41,13 @@ public interface ITenantAnnouncementReadRepository /// /// 已读实体。 /// 取消标记。 + /// 异步任务。 Task AddAsync(TenantAnnouncementRead record, CancellationToken cancellationToken = default); /// /// 保存变更。 /// /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantAnnouncementRepository.cs b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantAnnouncementRepository.cs index c3e34b6..2314d10 100644 --- a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantAnnouncementRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantAnnouncementRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; @@ -41,6 +38,7 @@ public interface ITenantAnnouncementRepository /// /// 公告实体。 /// 取消标记。 + /// 异步任务。 Task AddAsync(TenantAnnouncement announcement, CancellationToken cancellationToken = default); /// @@ -48,6 +46,7 @@ public interface ITenantAnnouncementRepository /// /// 公告实体。 /// 取消标记。 + /// 异步任务。 Task UpdateAsync(TenantAnnouncement announcement, CancellationToken cancellationToken = default); /// @@ -56,11 +55,13 @@ public interface ITenantAnnouncementRepository /// 租户 ID。 /// 公告 ID。 /// 取消标记。 + /// 异步任务。 Task DeleteAsync(long tenantId, long announcementId, CancellationToken cancellationToken = default); /// /// 保存变更。 /// /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantBillingRepository.cs b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantBillingRepository.cs index d4ddfa8..9edf1a4 100644 --- a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantBillingRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantBillingRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; @@ -50,6 +47,7 @@ public interface ITenantBillingRepository /// /// 账单实体。 /// 取消标记。 + /// 异步任务。 Task AddAsync(TenantBillingStatement bill, CancellationToken cancellationToken = default); /// @@ -57,11 +55,13 @@ public interface ITenantBillingRepository /// /// 账单实体。 /// 取消标记。 + /// 异步任务。 Task UpdateAsync(TenantBillingStatement bill, CancellationToken cancellationToken = default); /// /// 保存变更。 /// /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantNotificationRepository.cs b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantNotificationRepository.cs index b66093d..c81f613 100644 --- a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantNotificationRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantNotificationRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; @@ -43,6 +40,7 @@ public interface ITenantNotificationRepository /// /// 通知实体。 /// 取消标记。 + /// 异步任务。 Task AddAsync(TenantNotification notification, CancellationToken cancellationToken = default); /// @@ -50,11 +48,13 @@ public interface ITenantNotificationRepository /// /// 通知实体。 /// 取消标记。 + /// 异步任务。 Task UpdateAsync(TenantNotification notification, CancellationToken cancellationToken = default); /// /// 保存变更。 /// /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantPackageRepository.cs b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantPackageRepository.cs index 05e9f9f..4fe61d5 100644 --- a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantPackageRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantPackageRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Tenants.Entities; namespace TakeoutSaaS.Domain.Tenants.Repositories; @@ -32,6 +29,7 @@ public interface ITenantPackageRepository /// /// 套餐实体。 /// 取消标记。 + /// 异步任务。 Task AddAsync(TenantPackage package, CancellationToken cancellationToken = default); /// @@ -39,6 +37,7 @@ public interface ITenantPackageRepository /// /// 套餐实体。 /// 取消标记。 + /// 异步任务。 Task UpdateAsync(TenantPackage package, CancellationToken cancellationToken = default); /// @@ -46,11 +45,13 @@ public interface ITenantPackageRepository /// /// 套餐 ID(雪花算法)。 /// 取消标记。 + /// 异步任务。 Task DeleteAsync(long id, CancellationToken cancellationToken = default); /// /// 持久化。 /// /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantQuotaUsageRepository.cs b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantQuotaUsageRepository.cs index 07eae39..ff1b791 100644 --- a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantQuotaUsageRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantQuotaUsageRepository.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; @@ -33,6 +30,7 @@ public interface ITenantQuotaUsageRepository /// /// 配额使用实体。 /// 取消标记。 + /// 异步任务。 Task AddAsync(TenantQuotaUsage usage, CancellationToken cancellationToken = default); /// @@ -40,11 +38,13 @@ public interface ITenantQuotaUsageRepository /// /// 配额使用实体。 /// 取消标记。 + /// 异步任务。 Task UpdateAsync(TenantQuotaUsage usage, CancellationToken cancellationToken = default); /// /// 持久化。 /// /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantRepository.cs b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantRepository.cs index 33dedf9..c396852 100644 --- a/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantRepository.cs +++ b/src/Domain/TakeoutSaaS.Domain/Tenants/Repositories/ITenantRepository.cs @@ -1,5 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; @@ -35,6 +33,7 @@ public interface ITenantRepository /// /// 租户实体。 /// 取消标记。 + /// 异步任务。 Task AddTenantAsync(Tenant tenant, CancellationToken cancellationToken = default); /// @@ -42,6 +41,7 @@ public interface ITenantRepository /// /// 租户实体。 /// 取消标记。 + /// 异步任务。 Task UpdateTenantAsync(Tenant tenant, CancellationToken cancellationToken = default); /// @@ -65,6 +65,7 @@ public interface ITenantRepository /// /// 实名资料实体。 /// 取消标记。 + /// 异步任务。 Task UpsertVerificationProfileAsync(TenantVerificationProfile profile, CancellationToken cancellationToken = default); /// @@ -89,6 +90,7 @@ public interface ITenantRepository /// /// 订阅实体。 /// 取消标记。 + /// 异步任务。 Task AddSubscriptionAsync(TenantSubscription subscription, CancellationToken cancellationToken = default); /// @@ -96,6 +98,7 @@ public interface ITenantRepository /// /// 订阅实体。 /// 取消标记。 + /// 异步任务。 Task UpdateSubscriptionAsync(TenantSubscription subscription, CancellationToken cancellationToken = default); /// @@ -103,6 +106,7 @@ public interface ITenantRepository /// /// 订阅历史实体。 /// 取消标记。 + /// 异步任务。 Task AddSubscriptionHistoryAsync(TenantSubscriptionHistory history, CancellationToken cancellationToken = default); /// @@ -118,6 +122,7 @@ public interface ITenantRepository /// /// 审核日志实体。 /// 取消标记。 + /// 异步任务。 Task AddAuditLogAsync(TenantAuditLog log, CancellationToken cancellationToken = default); /// @@ -132,5 +137,6 @@ public interface ITenantRepository /// 持久化。 /// /// 取消标记。 + /// 异步任务。 Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/src/Gateway/TakeoutSaaS.ApiGateway/Program.cs b/src/Gateway/TakeoutSaaS.ApiGateway/Program.cs index c087384..6011bd9 100644 --- a/src/Gateway/TakeoutSaaS.ApiGateway/Program.cs +++ b/src/Gateway/TakeoutSaaS.ApiGateway/Program.cs @@ -1,16 +1,13 @@ -using System.Diagnostics; -using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Diagnostics; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.HttpOverrides; -using Microsoft.AspNetCore.RateLimiting; using OpenTelemetry.Logs; using OpenTelemetry.Metrics; using OpenTelemetry.Resources; using OpenTelemetry.Trace; using Serilog; -using TakeoutSaaS.ApiGateway.Configuration; +using System.Diagnostics; using System.Threading.RateLimiting; +using TakeoutSaaS.ApiGateway.Configuration; const string CorsPolicyName = "GatewayCors"; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Options/AppSeedOptions.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Options/AppSeedOptions.cs index b3ec66d..4099e12 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Options/AppSeedOptions.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Options/AppSeedOptions.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace TakeoutSaaS.Infrastructure.App.Options; /// diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Options/DictionarySeedGroupOptions.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Options/DictionarySeedGroupOptions.cs index 2cec142..c59ebb4 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Options/DictionarySeedGroupOptions.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Options/DictionarySeedGroupOptions.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using TakeoutSaaS.Domain.Dictionary.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Persistence/AppDataSeeder.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Persistence/AppDataSeeder.cs index 4072f0c..bd3fca8 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Persistence/AppDataSeeder.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Persistence/AppDataSeeder.cs @@ -1,11 +1,9 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using TakeoutSaaS.Domain.Dictionary.Entities; -using TakeoutSaaS.Domain.Dictionary.Enums; using TakeoutSaaS.Domain.SystemParameters.Entities; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfDeliveryRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfDeliveryRepository.cs index 2a67038..3bc734d 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfDeliveryRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfDeliveryRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Deliveries.Entities; using TakeoutSaaS.Domain.Deliveries.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfMerchantCategoryRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfMerchantCategoryRepository.cs index 8b83a3e..f832908 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfMerchantCategoryRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfMerchantCategoryRepository.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Merchants.Entities; using TakeoutSaaS.Domain.Merchants.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfMerchantRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfMerchantRepository.cs index cef1a73..7aa7c65 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfMerchantRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfMerchantRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Merchants.Entities; using TakeoutSaaS.Domain.Merchants.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfOrderRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfOrderRepository.cs index b5a2c7f..ba663d4 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfOrderRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfOrderRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Orders.Entities; using TakeoutSaaS.Domain.Orders.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfPaymentRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfPaymentRepository.cs index 4178313..1b6ea8d 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfPaymentRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfPaymentRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Payments.Entities; using TakeoutSaaS.Domain.Payments.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfProductRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfProductRepository.cs index 244578a..a888990 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfProductRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfProductRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Products.Entities; using TakeoutSaaS.Domain.Products.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfStoreRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfStoreRepository.cs index 53f6b4f..c813978 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfStoreRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfStoreRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Stores.Entities; using TakeoutSaaS.Domain.Stores.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantAnnouncementReadRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantAnnouncementReadRepository.cs index 94b26a2..23236ae 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantAnnouncementReadRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantAnnouncementReadRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantAnnouncementRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantAnnouncementRepository.cs index 404152f..5ed5afd 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantAnnouncementRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantAnnouncementRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantBillingRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantBillingRepository.cs index 3083de5..7b939d5 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantBillingRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantBillingRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantNotificationRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantNotificationRepository.cs index 56cea39..27417cd 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantNotificationRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantNotificationRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantPackageRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantPackageRepository.cs index 0a2cd22..d23b429 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantPackageRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantPackageRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantQuotaUsageRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantQuotaUsageRepository.cs index 778bada..dd9c564 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantQuotaUsageRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantQuotaUsageRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantRepository.cs index 9c4ab49..850046d 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/App/Repositories/EfTenantRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Tenants.Entities; using TakeoutSaaS.Domain.Tenants.Enums; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Extensions/DatabaseServiceCollectionExtensions.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Extensions/DatabaseServiceCollectionExtensions.cs index 4f50569..e9940a0 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Extensions/DatabaseServiceCollectionExtensions.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Extensions/DatabaseServiceCollectionExtensions.cs @@ -3,8 +3,8 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using TakeoutSaaS.Infrastructure.Common.Options; using TakeoutSaaS.Infrastructure.Common.Persistence; -using TakeoutSaaS.Shared.Abstractions.Ids; using TakeoutSaaS.Shared.Abstractions.Data; +using TakeoutSaaS.Shared.Abstractions.Ids; using TakeoutSaaS.Shared.Kernel.Ids; namespace TakeoutSaaS.Infrastructure.Common.Extensions; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/AppDbContext.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/AppDbContext.cs index 4733274..1f06200 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/AppDbContext.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/AppDbContext.cs @@ -1,9 +1,9 @@ -using System.Reflection; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; +using System.Reflection; using TakeoutSaaS.Shared.Abstractions.Entities; -using TakeoutSaaS.Shared.Abstractions.Security; using TakeoutSaaS.Shared.Abstractions.Ids; +using TakeoutSaaS.Shared.Abstractions.Security; namespace TakeoutSaaS.Infrastructure.Common.Persistence; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DapperExecutor.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DapperExecutor.cs index e0761aa..d9defe1 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DapperExecutor.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DapperExecutor.cs @@ -1,6 +1,6 @@ -using System.Data; using Microsoft.Extensions.Logging; using Npgsql; +using System.Data; using TakeoutSaaS.Shared.Abstractions.Data; namespace TakeoutSaaS.Infrastructure.Common.Persistence; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DatabaseConnectionFactory.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DatabaseConnectionFactory.cs index 7852aaa..54fee08 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DatabaseConnectionFactory.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DatabaseConnectionFactory.cs @@ -1,9 +1,8 @@ -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Security.Cryptography; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using System.ComponentModel.DataAnnotations; +using System.Security.Cryptography; using TakeoutSaaS.Infrastructure.Common.Options; using TakeoutSaaS.Shared.Abstractions.Data; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DesignTime/DesignTimeDbContextFactoryBase.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DesignTime/DesignTimeDbContextFactoryBase.cs index 5a2cf5f..a2dcba9 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DesignTime/DesignTimeDbContextFactoryBase.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/DesignTime/DesignTimeDbContextFactoryBase.cs @@ -1,6 +1,3 @@ -using System; -using System.IO; -using System.Linq; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/ModelBuilderCommentExtensions.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/ModelBuilderCommentExtensions.cs index e143c8f..193409c 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/ModelBuilderCommentExtensions.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/ModelBuilderCommentExtensions.cs @@ -1,8 +1,8 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; using System.Collections.Concurrent; using System.Reflection; using System.Xml.Linq; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; namespace TakeoutSaaS.Infrastructure.Common.Persistence; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/TenantAwareDbContext.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/TenantAwareDbContext.cs index f743d24..66e0f41 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/TenantAwareDbContext.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Common/Persistence/TenantAwareDbContext.cs @@ -1,9 +1,9 @@ -using System.Reflection; using Microsoft.EntityFrameworkCore; +using System.Reflection; using TakeoutSaaS.Shared.Abstractions.Entities; +using TakeoutSaaS.Shared.Abstractions.Ids; using TakeoutSaaS.Shared.Abstractions.Security; using TakeoutSaaS.Shared.Abstractions.Tenancy; -using TakeoutSaaS.Shared.Abstractions.Ids; namespace TakeoutSaaS.Infrastructure.Common.Persistence; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Extensions/DictionaryServiceCollectionExtensions.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Extensions/DictionaryServiceCollectionExtensions.cs index 41cc530..0055d45 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Extensions/DictionaryServiceCollectionExtensions.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Extensions/DictionaryServiceCollectionExtensions.cs @@ -1,16 +1,14 @@ -using System; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using TakeoutSaaS.Application.Dictionary.Abstractions; using TakeoutSaaS.Domain.Dictionary.Repositories; +using TakeoutSaaS.Domain.SystemParameters.Repositories; using TakeoutSaaS.Infrastructure.Common.Extensions; -using TakeoutSaaS.Infrastructure.Common.Options; using TakeoutSaaS.Infrastructure.Dictionary.Options; using TakeoutSaaS.Infrastructure.Dictionary.Persistence; using TakeoutSaaS.Infrastructure.Dictionary.Repositories; using TakeoutSaaS.Infrastructure.Dictionary.Services; using TakeoutSaaS.Shared.Abstractions.Constants; -using TakeoutSaaS.Domain.SystemParameters.Repositories; namespace TakeoutSaaS.Infrastructure.Dictionary.Extensions; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Repositories/EfDictionaryRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Repositories/EfDictionaryRepository.cs index 64e8608..4ce7005 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Repositories/EfDictionaryRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Repositories/EfDictionaryRepository.cs @@ -1,9 +1,8 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; -using TakeoutSaaS.Infrastructure.Dictionary.Persistence; using TakeoutSaaS.Domain.Dictionary.Entities; using TakeoutSaaS.Domain.Dictionary.Enums; using TakeoutSaaS.Domain.Dictionary.Repositories; +using TakeoutSaaS.Infrastructure.Dictionary.Persistence; namespace TakeoutSaaS.Infrastructure.Dictionary.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Repositories/EfSystemParameterRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Repositories/EfSystemParameterRepository.cs index 1ec7868..d7e515c 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Repositories/EfSystemParameterRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Repositories/EfSystemParameterRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.SystemParameters.Entities; using TakeoutSaaS.Domain.SystemParameters.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Services/DistributedDictionaryCache.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Services/DistributedDictionaryCache.cs index 372c467..4897f82 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Services/DistributedDictionaryCache.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Dictionary/Services/DistributedDictionaryCache.cs @@ -1,6 +1,6 @@ -using System.Text.Json; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Options; +using System.Text.Json; using TakeoutSaaS.Application.Dictionary.Abstractions; using TakeoutSaaS.Application.Dictionary.Models; using TakeoutSaaS.Infrastructure.Dictionary.Options; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Extensions/JwtAuthenticationExtensions.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Extensions/JwtAuthenticationExtensions.cs index 79c475c..b346321 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Extensions/JwtAuthenticationExtensions.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Extensions/JwtAuthenticationExtensions.cs @@ -1,11 +1,10 @@ -using System; -using System.IdentityModel.Tokens.Jwt; -using System.Security.Claims; -using System.Text; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.IdentityModel.Tokens; +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using System.Text; using TakeoutSaaS.Infrastructure.Identity.Options; namespace TakeoutSaaS.Infrastructure.Identity.Extensions; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Extensions/ServiceCollectionExtensions.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Extensions/ServiceCollectionExtensions.cs index d98587f..ef2fd47 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Extensions/ServiceCollectionExtensions.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Extensions/ServiceCollectionExtensions.cs @@ -1,12 +1,9 @@ -using System; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using TakeoutSaaS.Application.Identity.Abstractions; -using TakeoutSaaS.Domain.Identity.Entities; using TakeoutSaaS.Domain.Identity.Repositories; using TakeoutSaaS.Infrastructure.Common.Extensions; -using TakeoutSaaS.Infrastructure.Common.Options; using TakeoutSaaS.Infrastructure.Identity.Options; using TakeoutSaaS.Infrastructure.Identity.Persistence; using TakeoutSaaS.Infrastructure.Identity.Services; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfIdentityUserRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfIdentityUserRepository.cs index 02701f8..487428f 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfIdentityUserRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfIdentityUserRepository.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Identity.Entities; using TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfMiniUserRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfMiniUserRepository.cs index 83c7b61..78c3d52 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfMiniUserRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfMiniUserRepository.cs @@ -1,6 +1,3 @@ -using System; -using System.Threading; -using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Identity.Entities; using TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfPermissionRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfPermissionRepository.cs index 37b7a0d..b8dbafc 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfPermissionRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfPermissionRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Identity.Entities; using TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfRolePermissionRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfRolePermissionRepository.cs index 30376da..0ba4322 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfRolePermissionRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfRolePermissionRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Identity.Entities; using TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfRoleTemplateRepository.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfRoleTemplateRepository.cs index e8c071b..2f77700 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfRoleTemplateRepository.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/EfRoleTemplateRepository.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.Linq; using Microsoft.EntityFrameworkCore; using TakeoutSaaS.Domain.Identity.Entities; using TakeoutSaaS.Domain.Identity.Repositories; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/IdentityDataSeeder.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/IdentityDataSeeder.cs index f4ec0a0..01c8da2 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/IdentityDataSeeder.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/IdentityDataSeeder.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/IdentityDbContext.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/IdentityDbContext.cs index 854b265..268a7c0 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/IdentityDbContext.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Persistence/IdentityDbContext.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using TakeoutSaaS.Domain.Identity.Entities; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/JwtTokenService.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/JwtTokenService.cs index 78d3f0e..71c3080 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/JwtTokenService.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/JwtTokenService.cs @@ -1,8 +1,8 @@ +using Microsoft.Extensions.Options; +using Microsoft.IdentityModel.Tokens; using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; using System.Text; -using Microsoft.Extensions.Options; -using Microsoft.IdentityModel.Tokens; using TakeoutSaaS.Application.Identity.Abstractions; using TakeoutSaaS.Application.Identity.Contracts; using TakeoutSaaS.Infrastructure.Identity.Options; @@ -32,7 +32,7 @@ public sealed class JwtTokenService(IRefreshTokenStore refreshTokenStore, IOptio // 1. 构建 JWT Claims(包含用户 ID、账号、租户 ID、商户 ID、角色、权限等) var claims = BuildClaims(profile); - + // 2. 创建签名凭据(使用 HMAC SHA256 算法) var signingCredentials = new SigningCredentials( new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_options.Secret)), @@ -49,7 +49,7 @@ public sealed class JwtTokenService(IRefreshTokenStore refreshTokenStore, IOptio // 4. 序列化 JWT 为字符串 var accessToken = _tokenHandler.WriteToken(jwt); - + // 5. 生成刷新令牌并存储到 Redis var refreshDescriptor = await refreshTokenStore.IssueAsync(profile.UserId, refreshExpires, cancellationToken); diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/RedisLoginRateLimiter.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/RedisLoginRateLimiter.cs index e997c2e..3516290 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/RedisLoginRateLimiter.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/RedisLoginRateLimiter.cs @@ -1,6 +1,3 @@ -using System; -using System.Threading; -using System.Threading.Tasks; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Options; using TakeoutSaaS.Application.Identity.Abstractions; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/RedisRefreshTokenStore.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/RedisRefreshTokenStore.cs index 36105e9..6c5651e 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/RedisRefreshTokenStore.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/RedisRefreshTokenStore.cs @@ -1,10 +1,7 @@ -using System; -using System.Security.Cryptography; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Options; +using System.Security.Cryptography; +using System.Text.Json; using TakeoutSaaS.Application.Identity.Abstractions; using TakeoutSaaS.Application.Identity.Models; using TakeoutSaaS.Infrastructure.Identity.Options; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/WeChatAuthService.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/WeChatAuthService.cs index 1bd8b1b..bbc6328 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/WeChatAuthService.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Identity/Services/WeChatAuthService.cs @@ -1,10 +1,6 @@ -using System; -using System.Net.Http; +using Microsoft.Extensions.Options; using System.Net.Http.Json; using System.Text.Json.Serialization; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Options; using TakeoutSaaS.Application.Identity.Abstractions; using TakeoutSaaS.Infrastructure.Identity.Options; using TakeoutSaaS.Shared.Abstractions.Constants; diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/20251202005208_InitSnowflake_App.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/20251202005208_InitSnowflake_App.cs index 4b31527..6e26a56 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/20251202005208_InitSnowflake_App.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/20251202005208_InitSnowflake_App.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/DictionaryDb/20251202005247_InitSnowflake_Dictionary.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/DictionaryDb/20251202005247_InitSnowflake_Dictionary.cs index 374be49..7a1aa27 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/DictionaryDb/20251202005247_InitSnowflake_Dictionary.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/DictionaryDb/20251202005247_InitSnowflake_Dictionary.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/DictionaryDb/20251202043204_AddSystemParametersTable.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/DictionaryDb/20251202043204_AddSystemParametersTable.cs index 816fe03..27d688a 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/DictionaryDb/20251202043204_AddSystemParametersTable.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/DictionaryDb/20251202043204_AddSystemParametersTable.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/IdentityDb/20251202005226_InitSnowflake_Identity.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/IdentityDb/20251202005226_InitSnowflake_Identity.cs index 772ad91..4893332 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/IdentityDb/20251202005226_InitSnowflake_Identity.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/IdentityDb/20251202005226_InitSnowflake_Identity.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/IdentityDb/20251202084523_AddRbacModel.cs b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/IdentityDb/20251202084523_AddRbacModel.cs index aa64905..42a404e 100644 --- a/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/IdentityDb/20251202084523_AddRbacModel.cs +++ b/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/IdentityDb/20251202084523_AddRbacModel.cs @@ -1,5 +1,4 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/Modules/TakeoutSaaS.Module.Authorization/Policies/PermissionAuthorizationHandler.cs b/src/Modules/TakeoutSaaS.Module.Authorization/Policies/PermissionAuthorizationHandler.cs index b8df4fe..780e58d 100644 --- a/src/Modules/TakeoutSaaS.Module.Authorization/Policies/PermissionAuthorizationHandler.cs +++ b/src/Modules/TakeoutSaaS.Module.Authorization/Policies/PermissionAuthorizationHandler.cs @@ -1,6 +1,3 @@ -using System; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; namespace TakeoutSaaS.Module.Authorization.Policies; diff --git a/src/Modules/TakeoutSaaS.Module.Delivery/TakeoutSaaS.Module.Delivery.csproj b/src/Modules/TakeoutSaaS.Module.Delivery/TakeoutSaaS.Module.Delivery.csproj index b407eac..ff77596 100644 --- a/src/Modules/TakeoutSaaS.Module.Delivery/TakeoutSaaS.Module.Delivery.csproj +++ b/src/Modules/TakeoutSaaS.Module.Delivery/TakeoutSaaS.Module.Delivery.csproj @@ -4,6 +4,9 @@ enable enable + + + diff --git a/src/Modules/TakeoutSaaS.Module.Messaging/Abstractions/IMessagePublisher.cs b/src/Modules/TakeoutSaaS.Module.Messaging/Abstractions/IMessagePublisher.cs index 666c554..456be39 100644 --- a/src/Modules/TakeoutSaaS.Module.Messaging/Abstractions/IMessagePublisher.cs +++ b/src/Modules/TakeoutSaaS.Module.Messaging/Abstractions/IMessagePublisher.cs @@ -1,6 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; - namespace TakeoutSaaS.Module.Messaging.Abstractions; /// diff --git a/src/Modules/TakeoutSaaS.Module.Messaging/Abstractions/IMessageSubscriber.cs b/src/Modules/TakeoutSaaS.Module.Messaging/Abstractions/IMessageSubscriber.cs index 1e7e0bd..685c523 100644 --- a/src/Modules/TakeoutSaaS.Module.Messaging/Abstractions/IMessageSubscriber.cs +++ b/src/Modules/TakeoutSaaS.Module.Messaging/Abstractions/IMessageSubscriber.cs @@ -1,7 +1,3 @@ -using System; -using System.Threading; -using System.Threading.Tasks; - namespace TakeoutSaaS.Module.Messaging.Abstractions; /// diff --git a/src/Modules/TakeoutSaaS.Module.Messaging/Services/RabbitMqMessagePublisher.cs b/src/Modules/TakeoutSaaS.Module.Messaging/Services/RabbitMqMessagePublisher.cs index 6506acb..3f2178c 100644 --- a/src/Modules/TakeoutSaaS.Module.Messaging/Services/RabbitMqMessagePublisher.cs +++ b/src/Modules/TakeoutSaaS.Module.Messaging/Services/RabbitMqMessagePublisher.cs @@ -1,5 +1,3 @@ -using System; -using System.Text; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using RabbitMQ.Client; diff --git a/src/Modules/TakeoutSaaS.Module.Scheduler/Abstractions/IRecurringJobRegistrar.cs b/src/Modules/TakeoutSaaS.Module.Scheduler/Abstractions/IRecurringJobRegistrar.cs index 79f5a29..198da74 100644 --- a/src/Modules/TakeoutSaaS.Module.Scheduler/Abstractions/IRecurringJobRegistrar.cs +++ b/src/Modules/TakeoutSaaS.Module.Scheduler/Abstractions/IRecurringJobRegistrar.cs @@ -1,6 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; - namespace TakeoutSaaS.Module.Scheduler.Abstractions; /// diff --git a/src/Modules/TakeoutSaaS.Module.Sms/Abstractions/ISmsSender.cs b/src/Modules/TakeoutSaaS.Module.Sms/Abstractions/ISmsSender.cs index 5cf7dd5..01380db 100644 --- a/src/Modules/TakeoutSaaS.Module.Sms/Abstractions/ISmsSender.cs +++ b/src/Modules/TakeoutSaaS.Module.Sms/Abstractions/ISmsSender.cs @@ -1,5 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Module.Sms.Models; namespace TakeoutSaaS.Module.Sms.Abstractions; diff --git a/src/Modules/TakeoutSaaS.Module.Sms/Models/SmsSendRequest.cs b/src/Modules/TakeoutSaaS.Module.Sms/Models/SmsSendRequest.cs index 643f299..fe3b333 100644 --- a/src/Modules/TakeoutSaaS.Module.Sms/Models/SmsSendRequest.cs +++ b/src/Modules/TakeoutSaaS.Module.Sms/Models/SmsSendRequest.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; - namespace TakeoutSaaS.Module.Sms.Models; /// diff --git a/src/Modules/TakeoutSaaS.Module.Sms/Options/SmsOptions.cs b/src/Modules/TakeoutSaaS.Module.Sms/Options/SmsOptions.cs index 5520760..32c3ada 100644 --- a/src/Modules/TakeoutSaaS.Module.Sms/Options/SmsOptions.cs +++ b/src/Modules/TakeoutSaaS.Module.Sms/Options/SmsOptions.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using TakeoutSaaS.Module.Sms; namespace TakeoutSaaS.Module.Sms.Options; diff --git a/src/Modules/TakeoutSaaS.Module.Sms/Services/AliyunSmsSender.cs b/src/Modules/TakeoutSaaS.Module.Sms/Services/AliyunSmsSender.cs index 166d66e..11a4b2e 100644 --- a/src/Modules/TakeoutSaaS.Module.Sms/Services/AliyunSmsSender.cs +++ b/src/Modules/TakeoutSaaS.Module.Sms/Services/AliyunSmsSender.cs @@ -1,4 +1,3 @@ -using System.Net.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using TakeoutSaaS.Module.Sms.Abstractions; diff --git a/src/Modules/TakeoutSaaS.Module.Sms/Services/SmsSenderResolver.cs b/src/Modules/TakeoutSaaS.Module.Sms/Services/SmsSenderResolver.cs index e47f6be..2d5906b 100644 --- a/src/Modules/TakeoutSaaS.Module.Sms/Services/SmsSenderResolver.cs +++ b/src/Modules/TakeoutSaaS.Module.Sms/Services/SmsSenderResolver.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; using Microsoft.Extensions.Options; using TakeoutSaaS.Module.Sms.Abstractions; using TakeoutSaaS.Module.Sms.Options; diff --git a/src/Modules/TakeoutSaaS.Module.Sms/Services/TencentSmsSender.cs b/src/Modules/TakeoutSaaS.Module.Sms/Services/TencentSmsSender.cs index 72f8083..ee14a8f 100644 --- a/src/Modules/TakeoutSaaS.Module.Sms/Services/TencentSmsSender.cs +++ b/src/Modules/TakeoutSaaS.Module.Sms/Services/TencentSmsSender.cs @@ -1,10 +1,9 @@ +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using System.Globalization; -using System.Net.Http; using System.Security.Cryptography; using System.Text; using System.Text.Json; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using TakeoutSaaS.Module.Sms.Abstractions; using TakeoutSaaS.Module.Sms.Models; using TakeoutSaaS.Module.Sms.Options; diff --git a/src/Modules/TakeoutSaaS.Module.Storage/Abstractions/IObjectStorageProvider.cs b/src/Modules/TakeoutSaaS.Module.Storage/Abstractions/IObjectStorageProvider.cs index c53009c..41b6e31 100644 --- a/src/Modules/TakeoutSaaS.Module.Storage/Abstractions/IObjectStorageProvider.cs +++ b/src/Modules/TakeoutSaaS.Module.Storage/Abstractions/IObjectStorageProvider.cs @@ -1,5 +1,3 @@ -using System.Threading; -using System.Threading.Tasks; using TakeoutSaaS.Module.Storage.Models; namespace TakeoutSaaS.Module.Storage.Abstractions; diff --git a/src/Modules/TakeoutSaaS.Module.Storage/Models/StorageDirectUploadResult.cs b/src/Modules/TakeoutSaaS.Module.Storage/Models/StorageDirectUploadResult.cs index 8bfade5..15d11dd 100644 --- a/src/Modules/TakeoutSaaS.Module.Storage/Models/StorageDirectUploadResult.cs +++ b/src/Modules/TakeoutSaaS.Module.Storage/Models/StorageDirectUploadResult.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - namespace TakeoutSaaS.Module.Storage.Models; /// diff --git a/src/Modules/TakeoutSaaS.Module.Storage/Models/StorageUploadRequest.cs b/src/Modules/TakeoutSaaS.Module.Storage/Models/StorageUploadRequest.cs index b718c18..795a614 100644 --- a/src/Modules/TakeoutSaaS.Module.Storage/Models/StorageUploadRequest.cs +++ b/src/Modules/TakeoutSaaS.Module.Storage/Models/StorageUploadRequest.cs @@ -1,6 +1,3 @@ -using System.Collections.Generic; -using System.IO; - namespace TakeoutSaaS.Module.Storage.Models; /// diff --git a/src/Modules/TakeoutSaaS.Module.Storage/Providers/AliyunOssStorageProvider.cs b/src/Modules/TakeoutSaaS.Module.Storage/Providers/AliyunOssStorageProvider.cs index b12fd4b..0244720 100644 --- a/src/Modules/TakeoutSaaS.Module.Storage/Providers/AliyunOssStorageProvider.cs +++ b/src/Modules/TakeoutSaaS.Module.Storage/Providers/AliyunOssStorageProvider.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; -using System.Threading.Tasks; using Aliyun.OSS; -using Aliyun.OSS.Util; using Microsoft.Extensions.Options; using TakeoutSaaS.Module.Storage.Abstractions; using TakeoutSaaS.Module.Storage.Models; diff --git a/src/Modules/TakeoutSaaS.Module.Storage/Providers/QiniuKodoStorageProvider.cs b/src/Modules/TakeoutSaaS.Module.Storage/Providers/QiniuKodoStorageProvider.cs index df6b05d..bccb657 100644 --- a/src/Modules/TakeoutSaaS.Module.Storage/Providers/QiniuKodoStorageProvider.cs +++ b/src/Modules/TakeoutSaaS.Module.Storage/Providers/QiniuKodoStorageProvider.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Extensions.Options; using TakeoutSaaS.Module.Storage.Options; diff --git a/src/Modules/TakeoutSaaS.Module.Storage/Providers/S3StorageProviderBase.cs b/src/Modules/TakeoutSaaS.Module.Storage/Providers/S3StorageProviderBase.cs index f42e34c..0745830 100644 --- a/src/Modules/TakeoutSaaS.Module.Storage/Providers/S3StorageProviderBase.cs +++ b/src/Modules/TakeoutSaaS.Module.Storage/Providers/S3StorageProviderBase.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Amazon; using Amazon.Runtime; using Amazon.S3; using Amazon.S3.Model; diff --git a/src/Modules/TakeoutSaaS.Module.Storage/Providers/TencentCosStorageProvider.cs b/src/Modules/TakeoutSaaS.Module.Storage/Providers/TencentCosStorageProvider.cs index fdd7795..259d6e4 100644 --- a/src/Modules/TakeoutSaaS.Module.Storage/Providers/TencentCosStorageProvider.cs +++ b/src/Modules/TakeoutSaaS.Module.Storage/Providers/TencentCosStorageProvider.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.Extensions.Options; using TakeoutSaaS.Module.Storage.Options; diff --git a/src/Modules/TakeoutSaaS.Module.Storage/Services/StorageProviderResolver.cs b/src/Modules/TakeoutSaaS.Module.Storage/Services/StorageProviderResolver.cs index 598d1ee..b1920c0 100644 --- a/src/Modules/TakeoutSaaS.Module.Storage/Services/StorageProviderResolver.cs +++ b/src/Modules/TakeoutSaaS.Module.Storage/Services/StorageProviderResolver.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; using Microsoft.Extensions.Options; using TakeoutSaaS.Module.Storage.Abstractions; using TakeoutSaaS.Module.Storage.Options; diff --git a/src/Modules/TakeoutSaaS.Module.Tenancy/TenantContextAccessor.cs b/src/Modules/TakeoutSaaS.Module.Tenancy/TenantContextAccessor.cs index 2a7f7ab..b3b0589 100644 --- a/src/Modules/TakeoutSaaS.Module.Tenancy/TenantContextAccessor.cs +++ b/src/Modules/TakeoutSaaS.Module.Tenancy/TenantContextAccessor.cs @@ -1,4 +1,3 @@ -using System.Threading; using TakeoutSaaS.Shared.Abstractions.Tenancy; namespace TakeoutSaaS.Module.Tenancy; diff --git a/src/Modules/TakeoutSaaS.Module.Tenancy/TenantResolutionMiddleware.cs b/src/Modules/TakeoutSaaS.Module.Tenancy/TenantResolutionMiddleware.cs index a5f6530..46c9770 100644 --- a/src/Modules/TakeoutSaaS.Module.Tenancy/TenantResolutionMiddleware.cs +++ b/src/Modules/TakeoutSaaS.Module.Tenancy/TenantResolutionMiddleware.cs @@ -1,4 +1,3 @@ -using System.Linq; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; diff --git a/src/Modules/TakeoutSaaS.Module.Tenancy/TenantResolutionOptions.cs b/src/Modules/TakeoutSaaS.Module.Tenancy/TenantResolutionOptions.cs index 7cd928d..e43afa3 100644 --- a/src/Modules/TakeoutSaaS.Module.Tenancy/TenantResolutionOptions.cs +++ b/src/Modules/TakeoutSaaS.Module.Tenancy/TenantResolutionOptions.cs @@ -33,7 +33,7 @@ public sealed class TenantResolutionOptions /// 根域(不含子域),用于形如 {tenant}.rootDomain 的场景,例如 admin.takeoutsaas.com。 /// public string? RootDomain { get; set; } - + /// /// 需要跳过租户解析的路径集合(如健康检查),默认仅包含 /health。 /// diff --git a/stylecop.json b/stylecop.json new file mode 100644 index 0000000..c5f59ab --- /dev/null +++ b/stylecop.json @@ -0,0 +1,7 @@ +{ + "settings": { + "documentationRules": { + "documentationCulture": "zh-CN" + } + } +}