12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- '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 }, // 教师姓名
- phone: { type: String, required: true, maxLength: 200 }, // 手机号
- idnumber: { type: String, required: true, maxLength: 200 }, // 身份证号
- gender: { type: String, required: true, maxLength: 200 }, // 教师性别
- // 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: true, maxLength: 200 }, // 邮箱
- openid: { type: String, required: false, maxLength: 200 }, // 微信openid
- age: { type: String, required: true, maxLength: 200 }, // 年龄
- birthday: { type: String, required: true, maxLength: 200 }, // 出生年月
- entrydate: { type: String, required: true, maxLength: 200 }, // 入职时间
- politics: { type: String, required: true, maxLength: 200 }, // 政治面貌
- department: { type: String, required: true, maxLength: 200 }, // 所在部门
- job: { type: String, required: true, maxLength: 200 }, // 职务
- protitle: { type: String, required: true, maxLength: 200 }, // 职称
- education: { type: String, required: true, maxLength: 200 }, // 最后学历
- degree: { type: String, required: true, maxLength: 200 }, // 最后学位
- major: { type: String, required: true, maxLength: 200 }, // 教师所学专业
- schlesson: { type: String, required: true, maxLength: 200 }, // 教师在校所教课程
- experience: { type: [ experienceInfo ], select: true }, // 教育培训经历(从大学开始)
- courses: { type: String, required: true, maxLength: 200 }, // 主讲课程
- academic: { type: [ academicInfo ], select: true }, // 主要学术成果及获奖情况
- jobyear: { type: String, required: true, maxLength: 200 }, // 从事就业创业教学工作年限
- jobaddress: { type: String, required: false, maxLength: 500 }, // 工作地点
- subid: { type: String, required: true, maxLength: 200 }, // 科目id
- islyteacher: { type: String, required: true, 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, default: '0' },
- // 状态: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');
- };
|