feat: add tenant admin engagement endpoints

This commit is contained in:
xiong
2026-07-26 19:15:39 +08:00
parent dca6e8c66d
commit 28befc57be
6 changed files with 930 additions and 0 deletions

View File

@@ -110,6 +110,65 @@ public sealed class TenantAdminRoleTemplateQueryDto
}
}
public sealed class TenantAdminBadgeQueryDto
{
public string? Category { get; set; }
public bool IncludeInactive { get; set; }
[Range(1, 500)]
public int? Limit { get; set; }
public TenantAdminBadgeFilter ToFilter()
{
return new TenantAdminBadgeFilter(Category, IncludeInactive, Limit);
}
}
public sealed class TenantAdminBadgeGrantQueryDto
{
public Guid? UserId { get; set; }
public Guid? BadgeId { get; set; }
[Range(1, 500)]
public int? Limit { get; set; }
public TenantAdminBadgeGrantFilter ToFilter()
{
return new TenantAdminBadgeGrantFilter(UserId, BadgeId, Limit);
}
}
public sealed class TenantAdminNotificationQueryDto
{
public Guid? UserId { get; set; }
public string? Status { get; set; }
public string? NotificationType { get; set; }
[Range(1, 500)]
public int? Limit { get; set; }
public TenantAdminNotificationFilter ToFilter()
{
return new TenantAdminNotificationFilter(UserId, Status, NotificationType, Limit);
}
}
public sealed class TenantAdminFeedbackQueryDto
{
public Guid? UserId { get; set; }
public string? Status { get; set; }
public string? Type { get; set; }
public string? Keyword { get; set; }
[Range(1, 500)]
public int? Limit { get; set; }
public TenantAdminFeedbackFilter ToFilter()
{
return new TenantAdminFeedbackFilter(UserId, Status, Type, Keyword, Limit);
}
}
public sealed class UpsertTenantAdminClassDto
{
public Guid? Id { get; set; }
@@ -406,3 +465,109 @@ public sealed class UpsertTenantAuthProviderDto
return new UpsertTenantAuthProviderCommand(Provider, Status, DisplayName, ConfigPublic);
}
}
public sealed class UpsertTenantAdminBadgeDto
{
public Guid? Id { get; set; }
public string? LegacyId { get; set; }
public required string Name { get; set; }
public string? Description { get; set; }
public string? Category { get; set; }
public string? IconUrl { get; set; }
public int? Level { get; set; }
public string? UnlockType { get; set; }
public string? ConditionField { get; set; }
public string? ConditionOperator { get; set; }
public decimal? ConditionValue { get; set; }
public JsonElement ConditionExtra { get; set; } = JsonDefaults.Object();
public int? Order { get; set; }
public bool? IsActive { get; set; }
public UpsertTenantAdminBadgeCommand ToCommand()
{
return new UpsertTenantAdminBadgeCommand(
Id,
LegacyId,
Name,
Description,
Category,
IconUrl,
Level,
UnlockType,
ConditionField,
ConditionOperator,
ConditionValue,
ConditionExtra,
Order,
IsActive);
}
}
public sealed class GrantTenantAdminBadgeDto
{
[Required]
public Guid UserId { get; set; }
[Required]
public Guid BadgeId { get; set; }
public string? LegacyId { get; set; }
public string? Note { get; set; }
public DateTimeOffset? GrantedAt { get; set; }
public JsonElement Metadata { get; set; } = JsonDefaults.Object();
public GrantTenantAdminBadgeCommand ToCommand()
{
return new GrantTenantAdminBadgeCommand(UserId, BadgeId, LegacyId, Note, GrantedAt, Metadata);
}
}
public sealed class UpsertTenantAdminNotificationDto
{
[Required]
public Guid UserId { get; set; }
public required string NotificationType { get; set; }
public string? Severity { get; set; }
public required string Title { get; set; }
public required string Message { get; set; }
public string? ActionLabel { get; set; }
public string? ActionPath { get; set; }
public string? SourceType { get; set; }
public Guid? SourceId { get; set; }
public string? DedupeKey { get; set; }
public JsonElement Metadata { get; set; } = JsonDefaults.Object();
public UpsertTenantAdminNotificationCommand ToCommand()
{
return new UpsertTenantAdminNotificationCommand(
UserId,
NotificationType,
Severity,
Title,
Message,
ActionLabel,
ActionPath,
SourceType,
SourceId,
DedupeKey,
Metadata);
}
}
public sealed class UpdateTenantAdminFeedbackDto
{
[Required]
public Guid FeedbackId { get; set; }
public string? Status { get; set; }
public string? Priority { get; set; }
public string? Resolution { get; set; }
public string? Note { get; set; }
public JsonElement Metadata { get; set; } = JsonDefaults.Object();
public UpdateTenantAdminFeedbackCommand ToCommand()
{
return new UpdateTenantAdminFeedbackCommand(FeedbackId, Status, Priority, Resolution, Note, Metadata);
}
}