返回 AiToEarn
id.schema.ts
根目录 / project / aitoearn-electron / server / src / db / id.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: 自增主键ID
7 */
8 import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
9 import { Document } from 'mongoose';
10
11 export type IdDocument = Id & Document;
12 @Schema({ collection: 't_ids', versionKey: false })
13 export class Id {
14 @Prop({ required: true })
15 id_value: number;
16
17 @Prop({ required: true })
18 id_name: string;
19
20 @Prop()
21 update_time: number;
22 }
23 export const IdSchema = SchemaFactory.createForClass(Id);
24
24 lines TYPESCRIPT