teaplan.js 772 B

123456789101112131415161718192021
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 班主任全年计划表
  5. const TeaplanSchema = {
  6. trainplanid: { type: String, required: true, maxLength: 200 }, // 培训计划表id
  7. nodate: { type: [ String ], required: false, maxLength: 200 }, // 不能上课的日期(数组)
  8. classid: { type: String, required: false, maxLength: 200 }, // 班id
  9. headteacherid: { type: String, required: false, maxLength: 200 }, // 班主任id
  10. };
  11. const schema = new Schema(TeaplanSchema, { toJSON: { virtuals: true } });
  12. schema.index({ id: 1 });
  13. schema.plugin(metaPlugin);
  14. module.exports = app => {
  15. const { mongoose } = app;
  16. return mongoose.model('Teaplan', schema, 'teaplan');
  17. };