mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2026-09-13 07:43:43 +08:00
refactor(chat-core): MessageActorType 拆分为 MessageSenderType + MessageReceiverType
后端早已是两个独立枚举(MessageSenderType / MessageReceiverType), 前端跟着拆。字面值集合相同,但语义独立 — sender/receiver 各自的 type 列分别用对应类型,符合多态关联的模型(spec 02-data-model §5.1)。
This commit is contained in:
parent
5c8b6dc014
commit
57dabd61d4
@ -7,7 +7,19 @@ export type MessageDirection = 'INBOUND' | 'OUTBOUND';
|
||||
|
||||
export type MessageType = 'TEXT' | 'IMAGE' | 'VIDEO' | 'SYSTEM' | 'UNKNOWN';
|
||||
|
||||
export type MessageActorType = 'MEDIA_USER' | 'MEDIA_ACCOUNT' | 'SYSTEM';
|
||||
/**
|
||||
* Message sender type — polymorphic discriminator for (senderType, senderId).
|
||||
* INBOUND → MEDIA_USER, OUTBOUND → MEDIA_ACCOUNT, SYSTEM → SYSTEM (id is null).
|
||||
* Agent never appears here; the operator is tracked via operatorAgentId.
|
||||
*/
|
||||
export type MessageSenderType = 'MEDIA_USER' | 'MEDIA_ACCOUNT' | 'SYSTEM';
|
||||
|
||||
/**
|
||||
* Message receiver type — polymorphic discriminator for (receiverType, receiverId).
|
||||
* Mirror of sender side: INBOUND → MEDIA_ACCOUNT, OUTBOUND → MEDIA_USER,
|
||||
* SYSTEM → SYSTEM (id is null).
|
||||
*/
|
||||
export type MessageReceiverType = 'MEDIA_USER' | 'MEDIA_ACCOUNT' | 'SYSTEM';
|
||||
|
||||
export type SendStatus = 'PENDING' | 'SENDING' | 'SENT' | 'FAILED' | 'STUCK';
|
||||
|
||||
@ -42,12 +54,12 @@ export interface Message {
|
||||
direction: MessageDirection;
|
||||
msgType: MessageType;
|
||||
|
||||
senderType: MessageActorType;
|
||||
senderType: MessageSenderType;
|
||||
senderId?: number;
|
||||
senderExternalId?: string;
|
||||
sender?: MessageActorRef;
|
||||
|
||||
receiverType: MessageActorType;
|
||||
receiverType: MessageReceiverType;
|
||||
receiverId?: number;
|
||||
receiverExternalId?: string;
|
||||
receiver?: MessageActorRef;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user