feat: share chat page

This commit is contained in:
archer
2023-05-14 21:37:26 +08:00
parent d3e7923040
commit d31bdf0ee0
23 changed files with 2047 additions and 65 deletions
+14 -1
View File
@@ -1,5 +1,5 @@
import { ChatRoleEnum } from '@/constants/chat';
import type { InitChatResponse } from '@/api/response/chat';
import type { InitChatResponse, InitShareChatResponse } from '@/api/response/chat';
export type ExportChatType = 'md' | 'pdf' | 'html';
@@ -20,6 +20,10 @@ export interface ChatType extends InitChatResponse {
history: ChatSiteItemType[];
}
export interface ShareChatType extends InitShareChatResponse {
history: ChatSiteItemType[];
}
export type HistoryItemType = {
_id: string;
updateTime: Date;
@@ -27,3 +31,12 @@ export type HistoryItemType = {
title: string;
latestChat: string;
};
export type ShareChatHistoryItemType = {
_id: string;
shareId: string;
updateTime: Date;
title: string;
latestChat: string;
chats: ChatSiteItemType[];
};
+6
View File
@@ -33,3 +33,9 @@ export interface ShareModelItem {
share: ModelSchema['share'];
isCollection: boolean;
}
export type ShareChatEditType = {
name: string;
password: string;
maxContext: number;
};
+11
View File
@@ -137,3 +137,14 @@ export interface PromotionRecordSchema {
createTime: Date; // 记录时间
amount: number;
}
export interface ShareChatSchema {
_id: string;
userId: string;
modelId: string;
password: string;
name: string;
tokens: number;
maxContext: number;
lastTime: Date;
}