42 lines
946 B
TypeScript
42 lines
946 B
TypeScript
// 消息中心类型定义
|
||
|
||
// 消息类型
|
||
export type MessageType = 'sms' | 'email' | 'internal' | 'push';
|
||
|
||
// 消息状态
|
||
export type MessageStatus = 'pending' | 'sent' | 'failed' | 'read';
|
||
|
||
// 消息模板
|
||
export interface MessageTemplate {
|
||
id: string;
|
||
code: string;
|
||
name: string;
|
||
type: MessageType;
|
||
subject?: string;
|
||
content: string;
|
||
variables: string[]; // 变量列表,如 ['username', 'code', 'time']
|
||
isActive: boolean;
|
||
description?: string;
|
||
createdAt: string;
|
||
updatedAt: string;
|
||
createdBy?: string;
|
||
}
|
||
|
||
// 消息日志
|
||
export interface MessageLog {
|
||
id: string;
|
||
templateId?: string;
|
||
templateName?: string;
|
||
type: MessageType;
|
||
recipient: string; // 接收人(手机号/邮箱/用户ID)
|
||
recipientName?: string;
|
||
subject?: string;
|
||
content: string;
|
||
status: MessageStatus;
|
||
sentTime: string;
|
||
readTime?: string;
|
||
failReason?: string;
|
||
retryCount: number;
|
||
variables?: Record<string, any>;
|
||
}
|