返回 AiToEarn
publish-day-info.schema.ts
根目录 / project / aitoearn-backend / libs / mongodb / src / schemas / publish-day-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: 'publishDayInfo' })
13 export class PublishDayInfo extends WithTimestampSchema {
14 @Prop({
15 required: true,
16 index: true,
17 type: String,
18 default: '',
19 })
20 userId: string
21
22 // 发布总数
23 @Prop({
24 required: true,
25 type: Number,
26 default: 0,
27 })
28 publishTotal: number
29 }
30
31 export const PublishDayInfoSchema = SchemaFactory.createForClass(PublishDayInfo)
32
32 lines TYPESCRIPT