feat: 支持 push
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
import { PushType } from '../enums/push-type.enum';
|
||||
|
||||
export interface PushNotificationRequest {
|
||||
userIds: string[];
|
||||
title: string;
|
||||
body: string;
|
||||
payload?: any;
|
||||
pushType?: PushType;
|
||||
priority?: number;
|
||||
expiry?: number;
|
||||
collapseId?: string;
|
||||
}
|
||||
|
||||
export interface PushNotificationByTemplateRequest {
|
||||
userIds: string[];
|
||||
templateKey: string;
|
||||
data: any;
|
||||
payload?: any;
|
||||
}
|
||||
|
||||
export interface PushResult {
|
||||
userId: string;
|
||||
deviceToken: string;
|
||||
success: boolean;
|
||||
error?: string;
|
||||
apnsResponse?: any;
|
||||
}
|
||||
|
||||
export interface BatchPushResult {
|
||||
totalUsers: number;
|
||||
totalTokens: number;
|
||||
successCount: number;
|
||||
failedCount: number;
|
||||
results: PushResult[];
|
||||
}
|
||||
|
||||
export interface RenderedTemplate {
|
||||
title: string;
|
||||
body: string;
|
||||
payload?: any;
|
||||
pushType: PushType;
|
||||
priority: number;
|
||||
}
|
||||
|
||||
export interface PushStats {
|
||||
totalSent: number;
|
||||
totalFailed: number;
|
||||
successRate: number;
|
||||
averageDeliveryTime: number;
|
||||
errorBreakdown: Record<string, number>;
|
||||
}
|
||||
|
||||
export interface QueryOptions {
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
startDate?: Date;
|
||||
endDate?: Date;
|
||||
status?: string;
|
||||
messageType?: string;
|
||||
}
|
||||
|
||||
export interface TimeRange {
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user