'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 zynumberfileInfo = new Schema({ uri: { type: String, required: false, maxLength: 200 }, // 路径 name: { type: String, required: false, maxLength: 200 }, // 名称 }); // 资料路径详情 const urlInfo = new Schema({ uri: { type: String, required: false, maxLength: 200 }, // 路径 name: { type: String, required: false, maxLength: 200 }, // 名称 }); // 资料信息 const FileInfo = new Schema({ url: { type: [ urlInfo ], select: true }, // 资料路径 filename: { type: String, required: false, maxLength: 200 }, // 资料名称 type: { type: String, required: false, maxLength: 200 }, // 资料类别,教案(Word)、PPT、视频(Mp4)、其他(zip) }); // 教育培训经历 const experienceInfo = new Schema({ startDate: { type: String, required: false, maxLength: 200 }, // 开始日期 endDate: { type: String, required: false, maxLength: 200 }, // 结束日期 content: { type: String, required: false }, // 内容 }); // 主要学术成果及获奖情况 const academicInfo = new Schema({ startDate: { type: String, required: false, maxLength: 200 }, // 开始日期 endDate: { type: String, required: false, maxLength: 200 }, // 结束日期 content: { type: String, required: false }, // 内容 }); // 教师表 const TeacherSchema = { name: { type: String, required: true, maxLength: 200, zh: '姓名' }, // 教师姓名 phone: { type: String, required: true, maxLength: 200, zh: '手机号' }, // 手机号 gender: { type: String, required: false, maxLength: 200, zh: '性别' }, // 教师性别 idnumber: { type: String, required: false, maxLength: 200, zh: '身份证号' }, // 身份证号 secret: { type: String, required: false, maxLength: 200, zh: '密码' }, // zynumber: { type: String, required: false, maxLength: 200 }, // 职业资格证号 zynumberfile: { type: [ zynumberfileInfo ], select: true }, // 职业资格证图片 schid: { type: String, required: false, maxLength: 200 }, // 学校id schname: { type: String, required: false, maxLength: 200 }, // 学校名称 email: { type: String, required: false, maxLength: 200, zh: '邮箱' }, // 邮箱 openid: { type: String, required: false, maxLength: 200 }, // 微信openid age: { type: String, required: false, maxLength: 200, zh: '年龄' }, // 年龄 birthday: { type: String, required: false, maxLength: 200, zh: '出生年月' }, // 出生年月 entrydate: { type: String, required: false, maxLength: 200, zh: '入职时间' }, // 入职时间 politics: { type: String, required: false, maxLength: 200, zh: '政治面貌' }, // 政治面貌 department: { type: String, required: false, maxLength: 200, zh: '所在部门' }, // 所在部门 job: { type: String, required: false, maxLength: 200, zh: '职务' }, // 职务 protitle: { type: String, required: false, maxLength: 200, zh: '职称' }, // 职称 education: { type: String, required: false, maxLength: 200, zh: '最后学历' }, // 最后学历 degree: { type: String, required: false, maxLength: 200, zh: '最后学位' }, // 最后学位 major: { type: String, required: false, maxLength: 200, zh: '教师所学专业' }, // 教师所学专业 schlesson: { type: String, required: false, maxLength: 200, zh: '教师在校所教课程' }, // 教师在校所教课程 experience: { type: [ experienceInfo ], select: true }, // 教育培训经历(从大学开始) courses: { type: String, required: false, maxLength: 200, zh: '主讲课程' }, // 主讲课程 academic: { type: [ academicInfo ], select: true }, // 主要学术成果及获奖情况 jobyear: { type: String, required: false, maxLength: 200, zh: '从事就业创业教学工作年限' }, // 从事就业创业教学工作年限 jobaddress: { type: String, required: false, maxLength: 500, zh: '工作单位' }, // 工作单位 subid: { type: String, required: false, maxLength: 200 }, // 科目id islyteacher: { type: String, required: false, maxLength: 200 }, // 是否可讲礼仪课,0-否,1-是 zlscore: { type: String, required: false, maxLength: 200, zh: '资料评分' }, // 资料评分 msscore: { type: String, required: false, maxLength: 200, zh: '面试评分' }, // 面试评分 xsscore: { type: String, required: false, maxLength: 200, zh: '学生评分' }, // 学生评分 beforescore: { type: String, required: false, maxLength: 200 }, // 以前评分的平均分 file: { type: [ FileInfo ], select: false }, // 资料,教案PPT视频等 status: { type: String, required: false, maxLength: 200, default: '0' }, withpersonal: { type: String, required: false }, // 与人合作 career: { type: String, required: false }, // 职业探索 training: { type: String, required: false }, // 面试训练 nation: { type: String, required: false, maxLength: 200, zh: '民族' }, // 民族 qq: { type: String, required: false, maxLength: 200, zh: 'qq' }, // qq mobile: { type: String, required: false, maxLength: 200, zh: '固定电话' }, // 固定电话 course: { 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'); };