'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); // 职责说明表 const ExperienceSchema = { planid: { type: String, required: false }, // 计划id termid: { type: String, required: false }, // 班级id batchid: { type: String, required: false }, // 班级id classid: { type: String, ref: 'Class' }, // 班级id studentid: { type: String, ref: 'Student' }, // 学生id title: { type: String }, // 培训心得标题 content: { type: String }, // 培训心得内容 }; const schema = new Schema(ExperienceSchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Experience', schema, 'experience'); };