Files
knowai/types/chat/base.ts
tobegold574 382e3aff21 feat(reset): 以构造器模式重构
- 加了大文件传输自定义分片协议

BREAKING CHANGES: 0.1.0(latest)
2025-11-30 20:27:53 +08:00

26 lines
767 B
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 type { UserProfile } from '../user';
import type { ChatMessageType } from './types';
import type { BaseEntity } from '../common';
// 聊天消息接口
export interface ChatMessage extends BaseEntity {
// 聊天会话id下面那个接口的id
chatSessionId: string;
sender: UserProfile;
receiver: UserProfile;
content: string; // 只支持文本信息
type: ChatMessageType; // 实际无用
createdAt: Date;
// 无元数据,因为只有文本消息
}
// 聊天会话接口
export interface ChatSession extends BaseEntity {
id: string;
participant1: UserProfile;
participant2: UserProfile;
// 用于在聊天列表显示最后一句话
lastMessage?: ChatMessage;
// 没有已读和未读
}