'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); // 班主任表 const HeadteacherSchema = { name: { type: String, required: true, maxLength: 200 }, // 姓名 gender: { type: String, required: false, maxLength: 200 }, // 教师性别 department: { type: String, required: false, maxLength: 200 }, // 所在部门 mobile: { type: String, required: true, maxLength: 200 }, // 手机号 nation: { type: String, required: false, maxLength: 200 }, // 民族 phone: { type: String, required: false, maxLength: 200 }, // 固话 idnumber: { type: String, required: false, maxLength: 18 }, // 身份证 politics: { type: String, required: false, maxLength: 18 }, // 政治面貌 jobaddress: { type: String, required: false, maxLength: 18 }, // 工作单位 job: { type: String, required: false, maxLength: 200 }, // 职务 protitle: { type: String, required: false, maxLength: 200 }, // 职称 education: { type: String, required: false, maxLength: 200 }, // 最后学历 degree: { type: String, required: false, maxLength: 200 }, // 最后学位 qq: { type: String, required: false, maxLength: 200 }, // qq age: { type: String, required: false, maxLength: 200 }, // 年龄 eduexperience: { type: [ Object ], required: false, maxLength: 200 }, // 教育培训经历 islyteacher: { type: String, required: false, maxLength: 200 }, // 是否可讲礼仪课,0-否,1-是 openid: { type: String, required: false, maxLength: 200 }, // 微信openid status: { type: String, required: false, maxLength: 200, default: '0' }, // 状态:0,待审核;1,审核通过;2,审核拒绝 // birthday: { type: String, required: false, maxLength: 200 }, // 出生年月 }; const schema = new Schema(HeadteacherSchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Headteacher', schema, 'headteacher'); };