'use strict'; const Schema = require('mongoose').Schema; const SchemaDefine = { // 标题 title: { type: String, required: true }, // 姓名 name: { type: String, required: true }, // 电话 phone: { type: String, required: true }, // 单位 workUnit: { type: String, required: true }, // 地址 address: { type: String, required: true }, // 文件地址 url: { type: String, required: false }, // 用户id openid: { type: String, required: true }, // 状态 0=审核中,1=已审核, 2=已录用 status: { type: String, required: true }, }; const schema = new Schema(SchemaDefine); module.exports = app => { const { mongoose } = app; return mongoose.model('draft', schema, 'draft'); };