feat: add user notification center

This commit is contained in:
Codex
2026-06-30 03:56:41 +08:00
parent 2fea68fe4d
commit d72ff499ce
24 changed files with 895 additions and 44 deletions

View File

@@ -236,6 +236,29 @@ export interface TenantContentNotificationItem {
resolvedAt?: string | null;
}
export interface UserNotificationAdminItem {
id: string;
userId?: string;
userName?: string | null;
userPhone?: string | null;
userAvatarUrl?: string | null;
notificationType?: string;
status?: 'unread' | 'read' | 'dismissed' | 'archived';
severity?: 'info' | 'success' | 'warning' | 'error';
title?: string;
message?: string;
actionLabel?: string | null;
actionPath?: string | null;
sourceType?: string | null;
sourceId?: string | null;
metadata?: Record<string, unknown>;
createdBy?: string | null;
createdByName?: string | null;
readAt?: string | null;
createdAt?: string;
updatedAt?: string;
}
export interface ImportIssueItem {
id: string;
rowNo?: number | null;
@@ -1008,6 +1031,17 @@ export async function loadTenantContentNotifications(input: {
});
}
export async function loadUserNotifications(input: {
userId?: string;
status?: UserNotificationAdminItem['status'];
notificationType?: string;
limit?: number;
} = {}) {
return apiRequest<{ items?: UserNotificationAdminItem[]; summary?: Record<string, number> }>('/api/tenant-admin/user-notifications', {
query: { ...input, limit: input.limit || 100 },
});
}
export async function updateTenantContentNotificationStatus(input: {
notificationIds: string[];
status: 'read' | 'dismissed' | 'resolved';