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