| 1 | /* |
| 2 | * @Author: nevin |
| 3 | * @Date: 2021-12-24 13:46:31 |
| 4 | * @LastEditors: nevin |
| 5 | * @LastEditTime: 2024-08-30 15:01:32 |
| 6 | * @Description: 互动记录记录 interactionRecord |
| 7 | */ |
| 8 | import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose' |
| 9 | import { AccountType } from '@yikart/common' |
| 10 | import { DEFAULT_SCHEMA_OPTIONS } from '../channel-db.constants' |
| 11 | import { BaseTemp } from './time.tamp' |
| 12 | |
| 13 | @Schema({ ...DEFAULT_SCHEMA_OPTIONS, collection: 'interactionRecord' }) |
| 14 | export class InteractionRecord extends BaseTemp { |
| 15 | id: string |
| 16 | |
| 17 | @Prop({ |
| 18 | required: true, |
| 19 | index: true, |
| 20 | type: String, |
| 21 | }) |
| 22 | userId: string |
| 23 | |
| 24 | @Prop({ |
| 25 | required: true, |
| 26 | index: true, |
| 27 | type: String, |
| 28 | }) |
| 29 | accountId: string |
| 30 | |
| 31 | @Prop({ |
| 32 | required: true, |
| 33 | enum: AccountType, |
| 34 | }) |
| 35 | type: AccountType |
| 36 | |
| 37 | @Prop({ |
| 38 | required: true, |
| 39 | index: true, |
| 40 | type: String, |
| 41 | }) |
| 42 | worksId: string |
| 43 | |
| 44 | // 作品标题 |
| 45 | @Prop({ |
| 46 | type: String, |
| 47 | default: '', |
| 48 | }) |
| 49 | worksTitle?: string |
| 50 | |
| 51 | // 作品封面 |
| 52 | @Prop({ |
| 53 | type: String, |
| 54 | }) |
| 55 | worksCover?: string |
| 56 | |
| 57 | @Prop({ |
| 58 | type: String, |
| 59 | default: '', |
| 60 | }) |
| 61 | worksContent?: string |
| 62 | |
| 63 | @Prop({ |
| 64 | type: String, |
| 65 | }) |
| 66 | commentContent?: string |
| 67 | |
| 68 | // 评论时间 |
| 69 | @Prop({ |
| 70 | type: Date, |
| 71 | default: null, |
| 72 | }) |
| 73 | commentTime?: Date |
| 74 | |
| 75 | // 评论备注 |
| 76 | @Prop({ |
| 77 | type: String, |
| 78 | }) |
| 79 | commentRemark?: string |
| 80 | |
| 81 | // 点赞时间 |
| 82 | @Prop({ |
| 83 | type: Date, |
| 84 | }) |
| 85 | likeTime?: Date |
| 86 | |
| 87 | // 收藏时间 |
| 88 | @Prop({ |
| 89 | type: Date, |
| 90 | }) |
| 91 | collectTime?: Date |
| 92 | } |
| 93 | |
| 94 | export const InteractionRecordSchema = SchemaFactory.createForClass(InteractionRecord) |
| 95 |