forked from xiongyuxing/tiku-backend.net
feat: add tenant admin engagement endpoints
This commit is contained in:
@@ -154,4 +154,44 @@ public interface ITenantAdminDirectService
|
||||
TenantAdminActor actor,
|
||||
UpsertTenantAuthProviderCommand command,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<CatalogList<TenantAdminBadgeItem>> GetBadgesAsync(
|
||||
TenantAdminActor actor,
|
||||
TenantAdminBadgeFilter filter,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<ContentManagementResult<TenantAdminBadgeItem>> UpsertBadgeAsync(
|
||||
TenantAdminActor actor,
|
||||
UpsertTenantAdminBadgeCommand command,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<CatalogList<TenantAdminBadgeGrantItem>> GetBadgeGrantsAsync(
|
||||
TenantAdminActor actor,
|
||||
TenantAdminBadgeGrantFilter filter,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<ContentManagementResult<TenantAdminBadgeGrantItem>> GrantBadgeAsync(
|
||||
TenantAdminActor actor,
|
||||
GrantTenantAdminBadgeCommand command,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<CatalogList<TenantAdminNotificationItem>> GetNotificationsAsync(
|
||||
TenantAdminActor actor,
|
||||
TenantAdminNotificationFilter filter,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<ContentManagementResult<TenantAdminNotificationItem>> UpsertNotificationAsync(
|
||||
TenantAdminActor actor,
|
||||
UpsertTenantAdminNotificationCommand command,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<CatalogList<TenantAdminFeedbackItem>> GetFeedbacksAsync(
|
||||
TenantAdminActor actor,
|
||||
TenantAdminFeedbackFilter filter,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
Task<ContentManagementResult<TenantAdminFeedbackItem>> UpdateFeedbackAsync(
|
||||
TenantAdminActor actor,
|
||||
UpdateTenantAdminFeedbackCommand command,
|
||||
CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Text.Json;
|
||||
using Tiku.Domain.Common;
|
||||
using Tiku.Domain.Learning;
|
||||
using Tiku.Domain.Operations;
|
||||
using Tiku.Domain.Tenancy;
|
||||
|
||||
@@ -47,6 +48,29 @@ public sealed record TenantAdminRoleTemplateFilter(
|
||||
string? Status = null,
|
||||
int? Limit = null);
|
||||
|
||||
public sealed record TenantAdminBadgeFilter(
|
||||
string? Category = null,
|
||||
bool IncludeInactive = false,
|
||||
int? Limit = null);
|
||||
|
||||
public sealed record TenantAdminBadgeGrantFilter(
|
||||
Guid? UserId = null,
|
||||
Guid? BadgeId = null,
|
||||
int? Limit = null);
|
||||
|
||||
public sealed record TenantAdminNotificationFilter(
|
||||
Guid? UserId = null,
|
||||
string? Status = null,
|
||||
string? NotificationType = null,
|
||||
int? Limit = null);
|
||||
|
||||
public sealed record TenantAdminFeedbackFilter(
|
||||
Guid? UserId = null,
|
||||
string? Status = null,
|
||||
string? Type = null,
|
||||
string? Keyword = null,
|
||||
int? Limit = null);
|
||||
|
||||
public sealed record UpsertTenantAdminClassCommand(
|
||||
Guid? Id,
|
||||
Guid? RegionId,
|
||||
@@ -171,6 +195,51 @@ public sealed record UpsertTenantAuthProviderCommand(
|
||||
string? DisplayName,
|
||||
JsonElement ConfigPublic);
|
||||
|
||||
public sealed record UpsertTenantAdminBadgeCommand(
|
||||
Guid? Id,
|
||||
string? LegacyId,
|
||||
string Name,
|
||||
string? Description,
|
||||
string? Category,
|
||||
string? IconUrl,
|
||||
int? Level,
|
||||
string? UnlockType,
|
||||
string? ConditionField,
|
||||
string? ConditionOperator,
|
||||
decimal? ConditionValue,
|
||||
JsonElement ConditionExtra,
|
||||
int? Order,
|
||||
bool? IsActive);
|
||||
|
||||
public sealed record GrantTenantAdminBadgeCommand(
|
||||
Guid UserId,
|
||||
Guid BadgeId,
|
||||
string? LegacyId,
|
||||
string? Note,
|
||||
DateTimeOffset? GrantedAt,
|
||||
JsonElement Metadata);
|
||||
|
||||
public sealed record UpsertTenantAdminNotificationCommand(
|
||||
Guid UserId,
|
||||
string NotificationType,
|
||||
string? Severity,
|
||||
string Title,
|
||||
string Message,
|
||||
string? ActionLabel,
|
||||
string? ActionPath,
|
||||
string? SourceType,
|
||||
Guid? SourceId,
|
||||
string? DedupeKey,
|
||||
JsonElement Metadata);
|
||||
|
||||
public sealed record UpdateTenantAdminFeedbackCommand(
|
||||
Guid FeedbackId,
|
||||
string? Status,
|
||||
string? Priority,
|
||||
string? Resolution,
|
||||
string? Note,
|
||||
JsonElement Metadata);
|
||||
|
||||
public sealed record TenantAdminClassList(
|
||||
IReadOnlyCollection<TenantAdminClassItem> Items,
|
||||
bool Scoped);
|
||||
@@ -403,6 +472,82 @@ public sealed record TenantAuthProviderItem(
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset UpdatedAt);
|
||||
|
||||
public sealed record TenantAdminBadgeItem(
|
||||
Guid Id,
|
||||
string? LegacyId,
|
||||
string Name,
|
||||
string? Description,
|
||||
string? Category,
|
||||
string? IconUrl,
|
||||
int? Level,
|
||||
string? UnlockType,
|
||||
string? ConditionField,
|
||||
string? ConditionOperator,
|
||||
decimal? ConditionValue,
|
||||
JsonElement ConditionExtra,
|
||||
int Order,
|
||||
bool IsActive,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset UpdatedAt);
|
||||
|
||||
public sealed record TenantAdminBadgeGrantItem(
|
||||
Guid Id,
|
||||
string? LegacyId,
|
||||
Guid? UserId,
|
||||
string? UserName,
|
||||
string? UserPhone,
|
||||
Guid? BadgeId,
|
||||
string? BadgeName,
|
||||
string? BadgeCategory,
|
||||
string? IconUrl,
|
||||
int? Level,
|
||||
Guid? GrantedBy,
|
||||
string? GrantedByName,
|
||||
string? Note,
|
||||
DateTimeOffset? GrantedAt,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset UpdatedAt);
|
||||
|
||||
public sealed record TenantAdminNotificationItem(
|
||||
Guid Id,
|
||||
Guid UserId,
|
||||
string NotificationType,
|
||||
NotificationStatus Status,
|
||||
NotificationSeverity Severity,
|
||||
string Title,
|
||||
string Message,
|
||||
string? ActionLabel,
|
||||
string? ActionPath,
|
||||
string? SourceType,
|
||||
Guid? SourceId,
|
||||
string? DedupeKey,
|
||||
JsonElement Metadata,
|
||||
Guid? CreatedBy,
|
||||
DateTimeOffset? ReadAt,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset UpdatedAt);
|
||||
|
||||
public sealed record TenantAdminFeedbackItem(
|
||||
Guid Id,
|
||||
Guid? UserId,
|
||||
string? UserName,
|
||||
string? UserPhone,
|
||||
Guid? QuestionId,
|
||||
ReportType? Type,
|
||||
string? Title,
|
||||
string? Category,
|
||||
string? Description,
|
||||
ReportStatus Status,
|
||||
ReportPriority Priority,
|
||||
Guid? HandledBy,
|
||||
DateTimeOffset? HandledAt,
|
||||
string? Resolution,
|
||||
string? Contact,
|
||||
JsonElement Attachments,
|
||||
JsonElement Metadata,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset UpdatedAt);
|
||||
|
||||
public sealed class TenantAdminDirectException(string message, string code) : Exception(message)
|
||||
{
|
||||
public string Code { get; } = code;
|
||||
|
||||
Reference in New Issue
Block a user