'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); // 培训计划表 const TrainplanyearSchema = { year: { type: String, required: true, maxLength: 200 }, // 年份 title: { type: String, required: true, maxLength: 500 }, // 标题 remark: { type: String, required: false }, // 备注 }; const schema = new Schema(TrainplanyearSchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Trainplanyear', schema, 'trainplan_year'); };