12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- '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 }, // 资料地址
- file_name: { type: String, required: false, maxLength: 200 }, // 资料名称
- type: { type: String, required: false, maxLength: 200 }, // 资料类别
- });
- // 教师表
- const TeacherSchema = {
- name: { type: String, required: true, maxLength: 200 }, // 教师姓名
- password: { type: Secret, required: true, select: false, maxLength: 200 }, // 密码
- phone: { type: String, required: true, maxLength: 200 }, // 手机号
- id_number: { type: String, required: true, maxLength: 200 }, // 身份证号
- gender: { type: String, required: false, maxLength: 200 }, // 教师性别
- profession_number: { type: String, required: false, maxLength: 200 }, // 职业资格证号
- profession_number_file: { type: String, required: false, maxLength: 200 }, // 职业资格证图片
- school_code: { type: String, required: false, maxLength: 200 }, // 学校编码
- school_name: { 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 }, // 出生年月
- entry_time: { 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
- is_etiquette_teacher: { type: String, required: false, maxLength: 200 }, // 是否可讲礼仪课,0-否,1-是
- file_score: { type: String, required: false, maxLength: 200 }, // 资料评分
- interview_score: { type: String, required: false, maxLength: 200 }, // 面试评分
- student_score: { 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');
- };
|