| 1 | /* |
| 2 | * @Author: nevin |
| 3 | * @Date: 2022-11-16 22:04:18 |
| 4 | * @LastEditTime: 2024-11-22 09:53:38 |
| 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 FeedbackType { |
| 12 | errReport = 'errReport', // 错误反馈 |
| 13 | feedback = 'feedback', // 反馈 |
| 14 | msgReport = 'msgReport', // 消息举报 |
| 15 | msgFeedback = 'msgFeedback', // 消息反馈 |
| 16 | } |
| 17 | |
| 18 | @Schema({ |
| 19 | collection: 'feedback', |
| 20 | versionKey: false, |
| 21 | toJSON: { virtuals: true }, |
| 22 | toObject: { virtuals: true }, |
| 23 | }) |
| 24 | export class Feedback extends TimeTemp { |
| 25 | id: string; |
| 26 | |
| 27 | @Prop({ required: true }) |
| 28 | userId: string; |
| 29 | |
| 30 | @Prop({ comment: '用户名' }) |
| 31 | userName: string; |
| 32 | |
| 33 | @Prop({ |
| 34 | comment: '内容', |
| 35 | default: '', |
| 36 | }) |
| 37 | content: string; |
| 38 | |
| 39 | @Prop({ |
| 40 | default: FeedbackType.feedback, |
| 41 | enum: FeedbackType, |
| 42 | }) |
| 43 | type: FeedbackType; |
| 44 | |
| 45 | @Prop({ |
| 46 | comments: '标识数组', |
| 47 | type: [String], |
| 48 | default: [], |
| 49 | }) |
| 50 | tagList?: string[]; |
| 51 | |
| 52 | @Prop({ |
| 53 | comments: '文件链接数组', |
| 54 | type: [String], |
| 55 | default: [], |
| 56 | }) |
| 57 | fileUrlList: string[]; |
| 58 | } |
| 59 | |
| 60 | export const FeedbackSchema = SchemaFactory.createForClass(Feedback); |
| 61 |