返回 AiToEarn
publish-info.schema.ts
根目录 / project / aitoearn-backend / libs / mongodb / src / schemas / publish-info.schema.ts
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: 发布信息
7 */
8 import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'
9 import { DEFAULT_SCHEMA_OPTIONS } from '../mongodb.constants'
10 import { WithTimestampSchema } from './timestamp.schema'
11
12 @Schema({ ...DEFAULT_SCHEMA_OPTIONS, collection: 'publishInfo' })
13 export class PublishInfo extends WithTimestampSchema {
14 @Prop({
15 required: true,
16 index: true,
17 type: String,
18 default: '',
19 })
20 userId: string
21
22 @Prop({
23 index: true,
24 required: true,
25 type: Date,
26 })
27 upInfoDate: Date
28
29 // 已经连续发布的天数
30 @Prop({
31 type: Number,
32 default: 0,
33 })
34 days: number
35 }
36
37 export const PublishInfoSchema = SchemaFactory.createForClass(PublishInfo)
38
38 lines TYPESCRIPT