using System.ComponentModel.DataAnnotations; namespace TakeoutSaaS.Infrastructure.Identity.Options; /// /// 管理后台初始账号配置。 /// public sealed class AdminSeedOptions { /// /// 是否启用后台账号与权限种子。 /// public bool Enabled { get; set; } = true; /// /// 初始用户列表。 /// public List Users { get; set; } = new(); /// /// 角色模板种子列表。 /// public List RoleTemplates { get; set; } = new(); } /// /// 种子用户配置:用于初始化管理后台账号。 /// public sealed class SeedUserOptions { /// /// 登录账号。 /// [Required] public string Account { get; set; } = string.Empty; /// /// 登录密码(明文,将在初始化时进行哈希处理)。 /// [Required] public string Password { get; set; } = string.Empty; /// /// 展示名称。 /// [Required] public string DisplayName { get; set; } = string.Empty; /// /// 所属租户 ID。 /// public long TenantId { get; set; } /// /// 所属商户 ID(租户管理员为空)。 /// public long? MerchantId { get; set; } /// /// 角色集合。 /// public string[] Roles { get; set; } = Array.Empty(); /// /// 权限集合。 /// public string[] Permissions { get; set; } = Array.Empty(); } /// /// 角色模板种子配置。 /// public sealed class RoleTemplateSeedOptions { /// /// 模板编码。 /// [Required] public string TemplateCode { get; set; } = string.Empty; /// /// 模板名称。 /// [Required] public string Name { get; set; } = string.Empty; /// /// 模板描述。 /// public string? Description { get; set; } /// /// 是否启用。 /// public bool IsActive { get; set; } = true; /// /// 权限编码集合。 /// public string[] Permissions { get; set; } = Array.Empty(); }