'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); const Answerapply = { teacher: { type: String, required: true, maxLength: 200 }, // 教师 teacherid: { type: String, required: true, maxLength: 200 }, // 教师id date: { type: [ String ], required: true }, // 申请答疑的时间列表 subid: { type: String, required: true, maxLength: 200 }, // 科目id status: { type: String, maxLength: 200, default: '0' }, // 状态:0=>未审核;1=>通过;2=>拒绝 }; const schema = new Schema(Answerapply, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Answerapply', schema, 'answerapply'); };