新增会话管理功能,包括获取会话列表、获取会话详情和删除会话的API,更新AI教练模块以支持会话模型,调整相关服务和数据传输对象。
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Column, DataType, Index, Model, PrimaryKey, Table } from 'sequelize-typescript';
|
||||
import { BelongsTo, Column, DataType, ForeignKey, Model, PrimaryKey, Table } from 'sequelize-typescript';
|
||||
import { AiConversation } from './ai-conversation.model';
|
||||
|
||||
export enum RoleType {
|
||||
System = 'system',
|
||||
@@ -12,11 +13,11 @@ export enum RoleType {
|
||||
})
|
||||
export class AiMessage extends Model {
|
||||
@PrimaryKey
|
||||
@ForeignKey(() => AiConversation)
|
||||
@Column({
|
||||
type: DataType.STRING,
|
||||
allowNull: false,
|
||||
comment: '会话ID',
|
||||
primaryKey: true,
|
||||
})
|
||||
declare conversationId: string;
|
||||
|
||||
@@ -57,6 +58,9 @@ export class AiMessage extends Model {
|
||||
defaultValue: DataType.NOW,
|
||||
})
|
||||
declare updatedAt: Date;
|
||||
|
||||
@BelongsTo(() => AiConversation)
|
||||
declare conversation?: AiConversation;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user