清理代码
Some checks failed
ci / release-gate (push) Has been cancelled

This commit is contained in:
2026-08-03 12:31:39 +08:00
parent caea0062b0
commit c497a3ca8d
537 changed files with 14171 additions and 12503 deletions

View File

@@ -1,11 +1,11 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Tiku.Api.Contracts;
using Tiku.Application.Backoffice;
using Tiku.Application.Security;
using System.ComponentModel.DataAnnotations;
using Tiku.Api.OpenApi;
using Tiku.Application.Backoffice;
using Tiku.Application.PlatformAdmin;
using Tiku.Application.Security;
namespace Tiku.Api.Controllers;
@@ -35,7 +35,8 @@ public sealed class PlatformBackofficeController(
[ProducesResponseType<BackofficeBootstrap>(StatusCodes.Status200OK)]
public async Task<ActionResult<BackofficeBootstrap>> GetBootstrap(CancellationToken cancellationToken)
{
return Ok(await backofficeService.GetPlatformBootstrapAsync(await ResolveActorAsync(cancellationToken), cancellationToken));
return Ok(await backofficeService.GetPlatformBootstrapAsync(await ResolveActorAsync(cancellationToken),
cancellationToken));
}
[HttpPost("roles")]
@@ -46,7 +47,8 @@ public sealed class PlatformBackofficeController(
UpsertBackofficeRoleDto request,
CancellationToken cancellationToken)
{
return Ok(await backofficeService.UpsertPlatformRoleAsync(await ResolveActorAsync(cancellationToken), request.ToCommand(), cancellationToken));
return Ok(await backofficeService.UpsertPlatformRoleAsync(await ResolveActorAsync(cancellationToken),
request.ToCommand(), cancellationToken));
}
[HttpPut("roles/{roleId:guid}/bindings")]
@@ -58,10 +60,12 @@ public sealed class PlatformBackofficeController(
public async Task<ActionResult<PlatformCommandSubmission>> ReplaceRoleBindings(
Guid roleId,
ReplaceRoleBindingsDto request,
[FromHeader(Name = "Idempotency-Key"), Required] string idempotencyKey,
[FromHeader(Name = "Idempotency-Key")] [Required]
string idempotencyKey,
CancellationToken cancellationToken)
{
var result = await approvalService.ReplaceRoleBindingsAsync(await ResolveActorAsync(cancellationToken), request.ToCommand(roleId), idempotencyKey, cancellationToken);
var result = await approvalService.ReplaceRoleBindingsAsync(await ResolveActorAsync(cancellationToken),
request.ToCommand(roleId), idempotencyKey, cancellationToken);
return result.ExecutionStatus == "pending_approval" ? Accepted(result) : Ok(result);
}
@@ -74,7 +78,8 @@ public sealed class PlatformBackofficeController(
ReplaceUserRolesDto request,
CancellationToken cancellationToken)
{
await backofficeService.ReplacePlatformUserRolesAsync(await ResolveActorAsync(cancellationToken), request.ToCommand(userId), cancellationToken);
await backofficeService.ReplacePlatformUserRolesAsync(await ResolveActorAsync(cancellationToken),
request.ToCommand(userId), cancellationToken);
return NoContent();
}
@@ -82,4 +87,4 @@ public sealed class PlatformBackofficeController(
{
return BackofficeActor.FromPlatformAccess(await currentAccessContext.GetAsync(cancellationToken));
}
}
}