mirror of https://github.com/msgbyte/tailchat
refactor: unified messaging inbox content to payload
add compatible code for old message typepull/90/head
parent
3fdd036007
commit
cf2b4e4d2e
@ -1,18 +1,33 @@
|
|||||||
/**
|
/**
|
||||||
* 收件箱记录项类型
|
* 收件箱记录项类型
|
||||||
*/
|
*/
|
||||||
export interface InboxItem {
|
export interface BasicInboxItem {
|
||||||
_id: string;
|
_id: string;
|
||||||
userId: string;
|
userId: string;
|
||||||
readed: boolean;
|
readed: boolean;
|
||||||
type: 'message'; // will be more
|
type: string;
|
||||||
|
payload?: Record<string, any>;
|
||||||
|
createdAt: string;
|
||||||
|
updatedAt: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MessageInboxItem extends BasicInboxItem {
|
||||||
|
type: 'message';
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
message?: {
|
message?: {
|
||||||
groupId?: string;
|
groupId?: string;
|
||||||
converseId: string;
|
converseId: string;
|
||||||
messageId: string;
|
messageId: string;
|
||||||
messageSnippet: string;
|
messageSnippet: string;
|
||||||
};
|
};
|
||||||
payload?: Record<string, any>;
|
payload: {
|
||||||
createdAt: string;
|
groupId?: string;
|
||||||
updatedAt: string;
|
converseId: string;
|
||||||
|
messageId: string;
|
||||||
|
messageSnippet: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type InboxItem = MessageInboxItem;
|
||||||
|
Loading…
Reference in New Issue