add the logic to save chat record when open boss manually

This commit is contained in:
geekgeekrun
2024-11-03 23:12:58 +08:00
parent 2aa8bb05bb
commit d531c07e8b
4 changed files with 114 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
import { requireTypeorm } from "../utils/module-loader";
const { Entity, Column, PrimaryGeneratedColumn } = requireTypeorm()
@Entity()
export class ChatMessageRecord {
@PrimaryGeneratedColumn()
mid: number;
@Column()
encryptFromUserId: string;
@Column()
encryptToUserId: string;
@Column({
nullable: true
})
time: Date | null;
@Column({
nullable: true
})
type?: 'text' | 'image' | 'resume';
@Column({
nullable: true
})
style?: 'sent' | 'receive';
@Column({
nullable: true
})
text: string;
@Column({
nullable: true
})
imageUrl?: string;
@Column({
nullable: true
})
imageWidth?: number;
@Column({
nullable: true
})
imageHeight?: number;
}