'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); const { Secret } = require('naf-framework-mongoose/lib/model/schema'); // 资料信息 const FileInfo = new Schema({ url: { type: String, required: false, maxLength: 200 }, // 资料地址 filename: { type: String, required: false, maxLength: 200 }, // 资料名称 type: { type: String, required: false, maxLength: 200 }, // 资料类别 }); // 教师表 const TeacherSchema = { name: { type: String, required: true, maxLength: 200 }, // 教师姓名 phone: { type: String, required: true, maxLength: 200 }, // 手机号 idnumber: { type: String, required: true, maxLength: 200 }, // 身份证号 gender: { type: String, required: false, maxLength: 200 }, // 教师性别 zynumber: { type: String, required: false, maxLength: 200 }, // 职业资格证号 zynumberfile: { type: String, required: false, maxLength: 200 }, // 职业资格证图片 schid: { type: String, required: false, maxLength: 200 }, // 学校id schname: { type: String, required: false, maxLength: 200 }, // 学校名称 email: { type: String, required: false, maxLength: 200 }, // 邮箱 openid: { type: String, required: false, maxLength: 200 }, // 微信openid age: { type: String, required: false, maxLength: 200 }, // 年龄 birthday: { type: String, required: false, maxLength: 200 }, // 出生年月 entrydate: { type: String, required: false, maxLength: 200 }, // 入职时间 job: { type: String, required: false, maxLength: 200 }, // 职务 major: { type: String, required: false, maxLength: 200 }, // 专业 subid: { type: String, required: false, maxLength: 200 }, // 科目id islyteacher: { type: String, required: false, maxLength: 200 }, // 是否可讲礼仪课,0-否,1-是 zlscore: { type: String, required: false, maxLength: 200 }, // 资料评分 msscore: { type: String, required: false, maxLength: 200 }, // 面试评分 xsscore: { type: String, required: false, maxLength: 200 }, // 学生评分 file: { type: [ FileInfo ], select: false }, // 资料,教案PPT视频等 status: { type: String, required: false, maxLength: 200 }, // 状态:0-注册,1-确认身份,2-资料评分,3-面试评分,4-确认入库 } ; const schema = new Schema(TeacherSchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Teacher', schema, 'teacher'); };