增加聊天记录的存储和读取
This commit is contained in:
@@ -809,7 +809,35 @@ export class GirlData extends BaseData {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** 保存聊天记录 */
|
||||
public setChatRecord(categoryId: string, girlId: number, data: proto.cs.IChatMsg[]): void {
|
||||
let oneData = this.getGrilChat(categoryId, girlId);
|
||||
if (!oneData) return;
|
||||
oneData.setChatRecord(data);
|
||||
}
|
||||
|
||||
/** 获取聊天记录的所有 id */
|
||||
public getChatRecordIds(categoryId: string, girlId: number): number[] {
|
||||
let oneData = this.getGrilChat(categoryId, girlId);
|
||||
if (!oneData) return [];
|
||||
return oneData.getChatRecordIds();
|
||||
}
|
||||
|
||||
/** 获取聊天记录,根据 id,是否是 ai 聊天数据 */
|
||||
public getChatRecordIsAi(categoryId: string, girlId: number, id: number): boolean {
|
||||
let oneData = this.getGrilChat(categoryId, girlId);
|
||||
if (!oneData) return false;
|
||||
return oneData.getChatRecordIsAi(id);
|
||||
}
|
||||
|
||||
/** 获取聊天记录,根据 id,聊天内容 */
|
||||
public getChatRecordMsg(categoryId: string, girlId: number, id: number): string {
|
||||
let oneData = this.getGrilChat(categoryId, girlId);
|
||||
if (!oneData) return "";
|
||||
return oneData.getChatRecordMsg(id);
|
||||
}
|
||||
|
||||
/** --------------------------------------------------------- 技师的好感度数据 --------------------------------------------------------- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user