feat: 角色模板改为数据库管理支持前端自定义

This commit is contained in:
2025-12-03 20:38:26 +08:00
parent 19137f3cf7
commit 6a84141799
28 changed files with 901 additions and 652 deletions

View File

@@ -0,0 +1,36 @@
using System.Collections.Generic;
using MediatR;
using TakeoutSaaS.Application.Identity.Contracts;
namespace TakeoutSaaS.Application.Identity.Commands;
/// <summary>
/// 创建角色模板命令。
/// </summary>
public sealed record CreateRoleTemplateCommand : IRequest<RoleTemplateDto>
{
/// <summary>
/// 模板编码。
/// </summary>
public string TemplateCode { get; init; } = string.Empty;
/// <summary>
/// 模板名称。
/// </summary>
public string Name { get; init; } = string.Empty;
/// <summary>
/// 模板描述。
/// </summary>
public string? Description { get; init; }
/// <summary>
/// 是否启用。
/// </summary>
public bool IsActive { get; init; } = true;
/// <summary>
/// 权限编码集合。
/// </summary>
public IReadOnlyCollection<string> PermissionCodes { get; init; } = Array.Empty<string>();
}

View File

@@ -0,0 +1,14 @@
using MediatR;
namespace TakeoutSaaS.Application.Identity.Commands;
/// <summary>
/// 删除角色模板命令。
/// </summary>
public sealed record DeleteRoleTemplateCommand : IRequest<bool>
{
/// <summary>
/// 模板编码。
/// </summary>
public string TemplateCode { get; init; } = string.Empty;
}

View File

@@ -0,0 +1,36 @@
using System.Collections.Generic;
using MediatR;
using TakeoutSaaS.Application.Identity.Contracts;
namespace TakeoutSaaS.Application.Identity.Commands;
/// <summary>
/// 更新角色模板命令。
/// </summary>
public sealed record UpdateRoleTemplateCommand : IRequest<RoleTemplateDto?>
{
/// <summary>
/// 模板编码(路径参数)。
/// </summary>
public string TemplateCode { get; init; } = string.Empty;
/// <summary>
/// 模板名称。
/// </summary>
public string Name { get; init; } = string.Empty;
/// <summary>
/// 模板描述。
/// </summary>
public string? Description { get; init; }
/// <summary>
/// 是否启用。
/// </summary>
public bool IsActive { get; init; } = true;
/// <summary>
/// 权限编码集合。
/// </summary>
public IReadOnlyCollection<string> PermissionCodes { get; init; } = Array.Empty<string>();
}