/** * @author songxiwen * @date 2020/12/06 13:40 */ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; import { MongoDBCollection } from '../../../constant'; @Schema({ collection: MongoDBCollection.ApiKey }) export class ApiKey extends Document { @Prop() isEnabled!: boolean; @Prop() thirdPartyPlatformId!: string; @Prop() key!: object; @Prop() remainingCount!: number; @Prop() isPaid!: boolean; @Prop() resetAt!: Date; @Prop() createdAt!: Date; @Prop() updatedAt!: Date; } export const apiKeySchema = SchemaFactory.createForClass(ApiKey);