teacher.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const { Secret } = require('naf-framework-mongoose/lib/model/schema');
  5. // 资料路径详情
  6. const zynumberfileInfo = new Schema({
  7. uri: { type: String, required: false, maxLength: 200 }, // 路径
  8. name: { type: String, required: false, maxLength: 200 }, // 名称
  9. });
  10. // 资料路径详情
  11. const urlInfo = new Schema({
  12. uri: { type: String, required: false, maxLength: 200 }, // 路径
  13. name: { type: String, required: false, maxLength: 200 }, // 名称
  14. });
  15. // 资料信息
  16. const FileInfo = new Schema({
  17. url: { type: [ urlInfo ], select: true }, // 资料路径
  18. filename: { type: String, required: false, maxLength: 200 }, // 资料名称
  19. type: { type: String, required: false, maxLength: 200 }, // 资料类别,教案(Word)、PPT、视频(Mp4)、其他(zip)
  20. });
  21. // 教育培训经历
  22. const experienceInfo = new Schema({
  23. startDate: { type: String, required: false, maxLength: 200 }, // 开始日期
  24. endDate: { type: String, required: false, maxLength: 200 }, // 结束日期
  25. content: { type: String, required: false }, // 内容
  26. });
  27. // 主要学术成果及获奖情况
  28. const academicInfo = new Schema({
  29. startDate: { type: String, required: false, maxLength: 200 }, // 开始日期
  30. endDate: { type: String, required: false, maxLength: 200 }, // 结束日期
  31. content: { type: String, required: false }, // 内容
  32. });
  33. // 教师表
  34. const TeacherSchema = {
  35. name: { type: String, required: true, maxLength: 200, zh: '姓名' }, // 教师姓名
  36. phone: { type: String, required: true, maxLength: 200, zh: '手机号' }, // 手机号
  37. gender: { type: String, required: false, maxLength: 200, zh: '性别' }, // 教师性别
  38. idnumber: { type: String, required: false, maxLength: 200, zh: '身份证号' }, // 身份证号
  39. secret: { type: String, required: false, maxLength: 200, zh: '密码' },
  40. // zynumber: { type: String, required: false, maxLength: 200 }, // 职业资格证号
  41. zynumberfile: { type: [ zynumberfileInfo ], select: true }, // 职业资格证图片
  42. schid: { type: String, required: false, maxLength: 200 }, // 学校id
  43. schname: { type: String, required: false, maxLength: 200 }, // 学校名称
  44. email: { type: String, required: false, maxLength: 200, zh: '邮箱' }, // 邮箱
  45. openid: { type: String, required: false, maxLength: 200 }, // 微信openid
  46. age: { type: String, required: false, maxLength: 200, zh: '年龄' }, // 年龄
  47. birthday: { type: String, required: false, maxLength: 200, zh: '出生年月' }, // 出生年月
  48. entrydate: { type: String, required: false, maxLength: 200, zh: '入职时间' }, // 入职时间
  49. politics: { type: String, required: false, maxLength: 200, zh: '政治面貌' }, // 政治面貌
  50. department: { type: String, required: false, maxLength: 200, zh: '所在部门' }, // 所在部门
  51. job: { type: String, required: false, maxLength: 200, zh: '职务' }, // 职务
  52. protitle: { type: String, required: false, maxLength: 200, zh: '职称' }, // 职称
  53. education: { type: String, required: false, maxLength: 200, zh: '最后学历' }, // 最后学历
  54. degree: { type: String, required: false, maxLength: 200, zh: '最后学位' }, // 最后学位
  55. major: { type: String, required: false, maxLength: 200, zh: '教师所学专业' }, // 教师所学专业
  56. schlesson: { type: String, required: false, maxLength: 200, zh: '教师在校所教课程' }, // 教师在校所教课程
  57. experience: { type: [ experienceInfo ], select: true }, // 教育培训经历(从大学开始)
  58. courses: { type: String, required: false, maxLength: 200, zh: '主讲课程' }, // 主讲课程
  59. academic: { type: [ academicInfo ], select: true }, // 主要学术成果及获奖情况
  60. jobyear: { type: String, required: false, maxLength: 200, zh: '从事就业创业教学工作年限' }, // 从事就业创业教学工作年限
  61. jobaddress: { type: String, required: false, maxLength: 500, zh: '工作单位' }, // 工作单位
  62. subid: { type: String, required: false, maxLength: 200 }, // 科目id
  63. islyteacher: { type: String, required: false, maxLength: 200 }, // 是否可讲礼仪课,0-否,1-是
  64. zlscore: { type: String, required: false, maxLength: 200, zh: '资料评分' }, // 资料评分
  65. msscore: { type: String, required: false, maxLength: 200, zh: '面试评分' }, // 面试评分
  66. xsscore: { type: String, required: false, maxLength: 200, zh: '学生评分' }, // 学生评分
  67. beforescore: { type: String, required: false, maxLength: 200 }, // 以前评分的平均分
  68. file: { type: [ FileInfo ], select: false }, // 资料,教案PPT视频等
  69. status: { type: String, required: false, maxLength: 200, default: '0' },
  70. withpersonal: { type: String, required: false }, // 与人合作
  71. career: { type: String, required: false }, // 职业探索
  72. training: { type: String, required: false }, // 面试训练
  73. nation: { type: String, required: false, maxLength: 200, zh: '民族' }, // 民族
  74. qq: { type: String, required: false, maxLength: 200, zh: 'qq' }, // qq
  75. mobile: { type: String, required: false, maxLength: 200, zh: '固定电话' }, // 固定电话
  76. course: { type: String, required: false, maxLength: 200 }, // 课程模块
  77. // 状态:0-注册,1-确认身份,2-资料评分,3-面试评分,4-确认入库
  78. };
  79. const schema = new Schema(TeacherSchema, { toJSON: { virtuals: true } });
  80. schema.index({ id: 1 });
  81. schema.plugin(metaPlugin);
  82. module.exports = app => {
  83. const { mongoose } = app;
  84. return mongoose.model('Teacher', schema, 'teacher');
  85. };