headteacher.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 班主任表
  5. const HeadteacherSchema = {
  6. name: { type: String, required: true, maxLength: 200 }, // 姓名
  7. gender: { type: String, required: false, maxLength: 200 }, // 教师性别
  8. department: { type: String, required: false, maxLength: 200 }, // 所在部门
  9. mobile: { type: String, required: true, maxLength: 200 }, // 手机号
  10. nation: { type: String, required: false, maxLength: 200 }, // 民族
  11. phone: { type: String, required: false, maxLength: 200 }, // 固话
  12. idnumber: { type: String, required: false, maxLength: 18 }, // 身份证
  13. politics: { type: String, required: false, maxLength: 18 }, // 政治面貌
  14. jobaddress: { type: String, required: false, maxLength: 18 }, // 工作单位
  15. job: { type: String, required: false, maxLength: 200 }, // 职务
  16. protitle: { type: String, required: false, maxLength: 200 }, // 职称
  17. education: { type: String, required: false, maxLength: 200 }, // 最后学历
  18. degree: { type: String, required: false, maxLength: 200 }, // 最后学位
  19. qq: { type: String, required: false, maxLength: 200 }, // qq
  20. age: { type: String, required: false, maxLength: 200 }, // 年龄
  21. eduexperience: { type: [ Object ], required: false, maxLength: 200 }, // 教育培训经历
  22. islyteacher: { type: String, required: false, maxLength: 200 }, // 是否可讲礼仪课,0-否,1-是
  23. openid: { type: String, required: false, maxLength: 200 }, // 微信openid
  24. status: { type: String, required: false, maxLength: 200, default: '0' }, // 状态:0,待审核;1,审核通过;2,审核拒绝
  25. // birthday: { type: String, required: false, maxLength: 200 }, // 出生年月
  26. };
  27. const schema = new Schema(HeadteacherSchema, { toJSON: { virtuals: true } });
  28. schema.index({ id: 1 });
  29. schema.plugin(metaPlugin);
  30. module.exports = app => {
  31. const { mongoose } = app;
  32. return mongoose.model('Headteacher', schema, 'headteacher');
  33. };