返回 AiToEarn
signIn.schema.ts
根目录 / project / aitoearn-electron / server / src / db / schema / signIn.schema.ts
1 /*
2 * @Author: nevin
3 * @Date: 2022-11-16 22:04:18
4 * @LastEditTime: 2025-04-27 17:34:58
5 * @LastEditors: nevin
6 * @Description: signIn SignIn
7 */
8 import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
9 import { TimeTemp } from './time.tamp';
10
11 export enum SignInType {
12 PUL_VIDEO = 'pul_video',
13 }
14
15 @Schema({
16 collection: 'signIn',
17 versionKey: false,
18 toJSON: { virtuals: true },
19 toObject: { virtuals: true },
20 })
21 export class SignIn extends TimeTemp {
22 id: string;
23
24 @Prop({ required: true, comment: '用户ID', index: true })
25 userId: string;
26
27 @Prop({ required: true, comment: '类型', enum: SignInType })
28 type: SignInType;
29
30 @Prop({ required: false, comment: '触发时的数据ID' })
31 dataId?: string;
32
33 @Prop({ required: false, comment: '描述' })
34 desc?: string;
35 }
36
37 export const SignInSchema = SchemaFactory.createForClass(SignIn);
38
38 lines TYPESCRIPT