Files
plates-server/src/push-notifications/dto/device-push-response.dto.ts
richarjiang cc83b84c80 feat(push): 新增设备推送和测试功能
- 新增基于设备令牌的推送通知接口
- 添加推送测试服务,支持应用启动时自动测试
- 新增推送测试文档说明
- 更新 APNS 配置和日志记录
- 迁移至 apns2 库的 PushType 枚举
- 替换订阅密钥文件
- 添加项目规则文档
2025-10-15 19:09:51 +08:00

51 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { ApiProperty } from '@nestjs/swagger';
import { ResponseCode } from '../../base.dto';
export class DevicePushResult {
@ApiProperty({ description: '设备令牌' })
deviceToken: string;
@ApiProperty({ description: '用户ID可选如果可获取' })
userId?: string;
@ApiProperty({ description: '是否成功' })
success: boolean;
@ApiProperty({ description: '错误信息', required: false })
error?: string;
@ApiProperty({ description: 'APNs响应', required: false })
apnsResponse?: any;
}
export class DevicePushResponseDto {
@ApiProperty({ description: '响应代码' })
code: ResponseCode;
@ApiProperty({ description: '响应消息' })
message: string;
@ApiProperty({ description: '推送结果' })
data: {
success: boolean;
sentCount: number;
failedCount: number;
results: DevicePushResult[];
};
}
export class BatchDevicePushResponseDto {
@ApiProperty({ description: '响应代码' })
code: ResponseCode;
@ApiProperty({ description: '响应消息' })
message: string;
@ApiProperty({ description: '批量推送结果' })
data: {
totalTokens: number;
successCount: number;
failedCount: number;
results: DevicePushResult[];
};
}