返回 AiToEarn
qaRecord.schema.ts
根目录 / project / aitoearn-electron / server / src / db / schema / qaRecord.schema.ts
1 /*
2 * @Author: nevin
3 * @Date: 2022-11-16 22:04:18
4 * @LastEditTime: 2025-04-14 17:40:15
5 * @LastEditors: nevin
6 * @Description: 反馈 Feedback feedback
7 */
8 import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
9 import { TimeTemp } from './time.tamp';
10
11 export enum QaRecordType {
12 QA = 'qa',
13 }
14
15 @Schema({
16 collection: 'qaRecord',
17 versionKey: false,
18 toJSON: { virtuals: true },
19 toObject: { virtuals: true },
20 })
21 export class QaRecord extends TimeTemp {
22 id: string;
23
24 @Prop({ comment: '标题', nullable: false })
25 title: string;
26
27 @Prop({
28 comment: '内容',
29 nullable: false,
30 })
31 content: string;
32
33 @Prop({
34 enum: QaRecordType,
35 comment: '类型',
36 default: QaRecordType.QA,
37 })
38 type: QaRecordType;
39
40 @Prop({
41 comments: '标识数组',
42 type: [String],
43 default: [],
44 })
45 tagList: string[];
46
47 @Prop({
48 comment: '排序',
49 default: 0,
50 })
51 sort?: number;
52 }
53
54 export const QaRecordSchema = SchemaFactory.createForClass(QaRecord);
55
55 lines TYPESCRIPT