feat(store): add quick business toggle endpoint and auto-approve creation
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 42s
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 42s
This commit is contained in:
@@ -108,5 +108,26 @@ public sealed class StoreController(IMediator mediator) : BaseApiController
|
||||
// 2. 返回成功响应
|
||||
return ApiResponse<object>.Ok(null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 快速切换门店经营状态。
|
||||
/// </summary>
|
||||
/// <param name="command">切换命令。</param>
|
||||
/// <param name="cancellationToken">取消标记。</param>
|
||||
/// <returns>切换后的门店信息。</returns>
|
||||
[HttpPost("toggle-business-status")]
|
||||
[ProducesResponseType(typeof(ApiResponse<StoreDto>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ApiResponse<StoreDto>), StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(typeof(ApiResponse<StoreDto>), StatusCodes.Status422UnprocessableEntity)]
|
||||
public async Task<ApiResponse<StoreDto>> ToggleBusinessStatus(
|
||||
[FromBody] ToggleBusinessStatusCommand command,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
// 1. 执行状态切换
|
||||
var result = await mediator.Send(command, cancellationToken);
|
||||
|
||||
// 2. 返回切换结果
|
||||
return ApiResponse<StoreDto>.Ok(result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user