forked from gongxuegit/tiku-backend.net
feat: add tenant admin configuration and governance endpoints
This commit is contained in:
@@ -67,6 +67,49 @@ public sealed class TenantAdminStudentActivityQueryDto
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class TenantAdminMemberQueryDto
|
||||
{
|
||||
public string? Role { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public string? Keyword { get; set; }
|
||||
|
||||
[Range(1, 500)]
|
||||
public int? Limit { get; set; }
|
||||
|
||||
public TenantAdminMemberFilter ToFilter()
|
||||
{
|
||||
return new TenantAdminMemberFilter(Role, Status, Keyword, Limit);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class TenantAdminAuditLogQueryDto
|
||||
{
|
||||
public string? Action { get; set; }
|
||||
public string? TargetType { get; set; }
|
||||
public Guid? ActorUserId { get; set; }
|
||||
|
||||
[Range(1, 500)]
|
||||
public int? Limit { get; set; }
|
||||
|
||||
public TenantAdminAuditLogFilter ToFilter()
|
||||
{
|
||||
return new TenantAdminAuditLogFilter(Action, TargetType, ActorUserId, Limit);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class TenantAdminRoleTemplateQueryDto
|
||||
{
|
||||
public string? Status { get; set; }
|
||||
|
||||
[Range(1, 500)]
|
||||
public int? Limit { get; set; }
|
||||
|
||||
public TenantAdminRoleTemplateFilter ToFilter()
|
||||
{
|
||||
return new TenantAdminRoleTemplateFilter(Status, Limit);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class UpsertTenantAdminClassDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
@@ -215,3 +258,151 @@ public sealed class UpsertTenantAdminStudentFollowupDto
|
||||
Metadata);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class UpsertTenantAdminMemberDto
|
||||
{
|
||||
public Guid? MembershipId { get; set; }
|
||||
public TenantAdminUserLookupDto User { get; set; } = new();
|
||||
public string? Role { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public Guid? RoleTemplateId { get; set; }
|
||||
public JsonElement Permissions { get; set; } = JsonDefaults.Object();
|
||||
public string? PrimaryRole { get; set; }
|
||||
|
||||
public UpsertTenantAdminMemberCommand ToCommand()
|
||||
{
|
||||
return new UpsertTenantAdminMemberCommand(MembershipId, User.ToCommand(), Role, Status, RoleTemplateId, Permissions, PrimaryRole);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DisableTenantAdminMemberDto
|
||||
{
|
||||
[Required]
|
||||
public Guid MembershipId { get; set; }
|
||||
}
|
||||
|
||||
public sealed class UpsertTenantAdminRoleTemplateDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public string? Code { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? BaseRole { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public JsonElement Permissions { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement MenuPermissions { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement ModulePermissions { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement FieldPermissions { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement DataScope { get; set; } = JsonDefaults.Object();
|
||||
public int? Order { get; set; }
|
||||
|
||||
public UpsertTenantAdminRoleTemplateCommand ToCommand()
|
||||
{
|
||||
return new UpsertTenantAdminRoleTemplateCommand(
|
||||
Id,
|
||||
Code,
|
||||
Name,
|
||||
Description,
|
||||
BaseRole,
|
||||
Status,
|
||||
Permissions,
|
||||
MenuPermissions,
|
||||
ModulePermissions,
|
||||
FieldPermissions,
|
||||
DataScope,
|
||||
Order);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DisableTenantAdminRoleTemplateDto
|
||||
{
|
||||
[Required]
|
||||
public Guid RoleTemplateId { get; set; }
|
||||
}
|
||||
|
||||
public sealed class UpsertTenantBrandingDto
|
||||
{
|
||||
public required string BrandName { get; set; }
|
||||
public string? ShortName { get; set; }
|
||||
public string? Slogan { get; set; }
|
||||
public string? OrganizationName { get; set; }
|
||||
public string? LogoUrl { get; set; }
|
||||
public string? FaviconUrl { get; set; }
|
||||
public string? ServiceWechat { get; set; }
|
||||
public string? ServiceAccountName { get; set; }
|
||||
|
||||
public UpsertTenantBrandingCommand ToCommand()
|
||||
{
|
||||
return new UpsertTenantBrandingCommand(
|
||||
BrandName,
|
||||
ShortName,
|
||||
Slogan,
|
||||
OrganizationName,
|
||||
LogoUrl,
|
||||
FaviconUrl,
|
||||
ServiceWechat,
|
||||
ServiceAccountName);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class UpsertTenantSettingsDto
|
||||
{
|
||||
public JsonElement FeatureFlags { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement AdminFeatureFlags { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement PublicConfig { get; set; } = JsonDefaults.Object();
|
||||
|
||||
public UpsertTenantSettingsCommand ToCommand()
|
||||
{
|
||||
return new UpsertTenantSettingsCommand(FeatureFlags, AdminFeatureFlags, PublicConfig);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class PreviewTenantThemeDto
|
||||
{
|
||||
public required string TemplateCode { get; set; }
|
||||
public JsonElement Theme { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement PublicAssets { get; set; } = JsonDefaults.Object();
|
||||
|
||||
public PreviewTenantThemeCommand ToCommand()
|
||||
{
|
||||
return new PreviewTenantThemeCommand(TemplateCode, Theme, PublicAssets);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class PublishTenantThemeDto
|
||||
{
|
||||
public bool? UseDraft { get; set; }
|
||||
public string? TemplateCode { get; set; }
|
||||
public JsonElement Theme { get; set; } = JsonDefaults.Object();
|
||||
public JsonElement PublicAssets { get; set; } = JsonDefaults.Object();
|
||||
|
||||
public PublishTenantThemeCommand ToCommand()
|
||||
{
|
||||
return new PublishTenantThemeCommand(UseDraft ?? true, TemplateCode, Theme, PublicAssets);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CreateTenantDomainDto
|
||||
{
|
||||
public required string Host { get; set; }
|
||||
public string? DomainType { get; set; }
|
||||
public bool IsPrimary { get; set; }
|
||||
|
||||
public CreateTenantDomainCommand ToCommand()
|
||||
{
|
||||
return new CreateTenantDomainCommand(Host, DomainType, IsPrimary);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class UpsertTenantAuthProviderDto
|
||||
{
|
||||
public required string Provider { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public string? DisplayName { get; set; }
|
||||
public JsonElement ConfigPublic { get; set; } = JsonDefaults.Object();
|
||||
|
||||
public UpsertTenantAuthProviderCommand ToCommand()
|
||||
{
|
||||
return new UpsertTenantAuthProviderCommand(Provider, Status, DisplayName, ConfigPublic);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user