teacher.js 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 }, // 教师姓名
  36. phone: { type: String, required: true, maxLength: 200 }, // 手机号
  37. idnumber: { type: String, required: true, maxLength: 200 }, // 身份证号
  38. gender: { type: String, required: true, maxLength: 200 }, // 教师性别
  39. // zynumber: { type: String, required: false, maxLength: 200 }, // 职业资格证号
  40. zynumberfile: { type: [ zynumberfileInfo ], select: true }, // 职业资格证图片
  41. schid: { type: String, required: false, maxLength: 200 }, // 学校id
  42. schname: { type: String, required: false, maxLength: 200 }, // 学校名称
  43. email: { type: String, required: true, maxLength: 200 }, // 邮箱
  44. openid: { type: String, required: false, maxLength: 200 }, // 微信openid
  45. age: { type: String, required: true, maxLength: 200 }, // 年龄
  46. birthday: { type: String, required: true, maxLength: 200 }, // 出生年月
  47. entrydate: { type: String, required: true, maxLength: 200 }, // 入职时间
  48. politics: { type: String, required: true, maxLength: 200 }, // 政治面貌
  49. department: { type: String, required: true, maxLength: 200 }, // 所在部门
  50. job: { type: String, required: true, maxLength: 200 }, // 职务
  51. protitle: { type: String, required: true, maxLength: 200 }, // 职称
  52. education: { type: String, required: true, maxLength: 200 }, // 最后学历
  53. degree: { type: String, required: true, maxLength: 200 }, // 最后学位
  54. major: { type: String, required: true, maxLength: 200 }, // 教师所学专业
  55. schlesson: { type: String, required: true, maxLength: 200 }, // 教师在校所教课程
  56. experience: { type: [ experienceInfo ], select: true }, // 教育培训经历(从大学开始)
  57. courses: { type: String, required: true, maxLength: 200 }, // 主讲课程
  58. academic: { type: [ academicInfo ], select: true }, // 主要学术成果及获奖情况
  59. jobyear: { type: String, required: true, maxLength: 200 }, // 从事就业创业教学工作年限
  60. jobaddress: { type: String, required: false, maxLength: 500 }, // 工作地点
  61. subid: { type: String, required: true, maxLength: 200 }, // 科目id
  62. islyteacher: { type: String, required: true, maxLength: 200 }, // 是否可讲礼仪课,0-否,1-是
  63. zlscore: { type: String, required: false, maxLength: 200 }, // 资料评分
  64. msscore: { type: String, required: false, maxLength: 200 }, // 面试评分
  65. xsscore: { type: String, required: false, maxLength: 200 }, // 学生评分
  66. file: { type: [ FileInfo ], select: false }, // 资料,教案PPT视频等
  67. status: { type: String, required: false, maxLength: 200, default: '0' },
  68. // 状态:0-注册,1-确认身份,2-资料评分,3-面试评分,4-确认入库
  69. };
  70. const schema = new Schema(TeacherSchema, { toJSON: { virtuals: true } });
  71. schema.index({ id: 1 });
  72. schema.plugin(metaPlugin);
  73. module.exports = app => {
  74. const { mongoose } = app;
  75. return mongoose.model('Teacher', schema, 'teacher');
  76. };