'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); // 职责说明表 const DutySchema = { bzduty: { type: String, required: false, maxLength: 2000 }, // 班长职责 xwduty: { type: String, required: false, maxLength: 2000 }, // 学委职责 }; const schema = new Schema(DutySchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Duty', schema, 'duty'); };