初始化:职引项目 v1.0
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'
|
||||
import { Document } from 'mongoose'
|
||||
|
||||
export type UserDocument = User & Document
|
||||
|
||||
@Schema({ timestamps: true })
|
||||
export class User {
|
||||
@Prop({ unique: true, sparse: true })
|
||||
phone?: string
|
||||
|
||||
@Prop({ unique: true, sparse: true })
|
||||
wxOpenid?: string
|
||||
|
||||
@Prop({ default: '' })
|
||||
nickname?: string
|
||||
|
||||
@Prop({ default: '' })
|
||||
avatar?: string
|
||||
|
||||
@Prop({ default: 0 })
|
||||
interviewCount: number
|
||||
|
||||
@Prop({ default: 3 })
|
||||
remaining: number
|
||||
|
||||
@Prop({ default: 'free' })
|
||||
plan: string
|
||||
|
||||
@Prop()
|
||||
vipExpireAt?: Date
|
||||
|
||||
@Prop({ default: 'user' })
|
||||
role: string // 'user' | 'admin'
|
||||
|
||||
@Prop({ default: false })
|
||||
isSystemAdmin: boolean
|
||||
|
||||
@Prop({ unique: true, sparse: true })
|
||||
email?: string
|
||||
}
|
||||
|
||||
export const UserSchema = SchemaFactory.createForClass(User)
|
||||
Reference in New Issue
Block a user