feat: 实现克隆租户角色接口
- POST /api/admin/v1/tenants/{tenantId}/roles/{roleId}/clone
- 支持复制角色基本信息和权限
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using MediatR;
|
||||
using TakeoutSaaS.Application.Identity.Contracts;
|
||||
|
||||
namespace TakeoutSaaS.Application.Identity.Commands;
|
||||
|
||||
/// <summary>
|
||||
/// 克隆租户角色命令。
|
||||
/// </summary>
|
||||
public sealed record CloneTenantRoleCommand : IRequest<RoleDto>
|
||||
{
|
||||
/// <summary>
|
||||
/// 租户 ID(由路由绑定)。
|
||||
/// </summary>
|
||||
public long TenantId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 源角色 ID(由路由绑定)。
|
||||
/// </summary>
|
||||
public long SourceRoleId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 新角色编码(租户内唯一)。
|
||||
/// </summary>
|
||||
public string NewCode { get; init; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 新角色名称(为空则沿用源角色)。
|
||||
/// </summary>
|
||||
public string? Name { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 新角色描述(为空则沿用源角色)。
|
||||
/// </summary>
|
||||
public string? Description { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否复制权限(默认 true)。
|
||||
/// </summary>
|
||||
public bool CopyPermissions { get; init; } = true;
|
||||
}
|
||||
Reference in New Issue
Block a user