初始化:职引项目 v1.0

This commit is contained in:
yuzhiran
2026-06-08 16:28:00 +08:00
commit 511f60d0db
111 changed files with 27295 additions and 0 deletions
+42
View File
@@ -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)