trainmodel.js 853 B

12345678910111213141516171819202122
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 全年计划模板表
  5. const TrainmodelSchema = {
  6. total: { type: String, required: false, maxLength: 200 }, // 总人数
  7. day: { type: String, required: false, maxLength: 200 }, // 课程所需天数
  8. color: { type: [ String ], required: false }, // 默认颜色
  9. batchnum: { type: String, required: false, maxLength: 200 }, // 默认期下生成的批次数
  10. classnum: { type: String, required: false, maxLength: 200 }, // 默认批次下生成的班级数
  11. };
  12. const schema = new Schema(TrainmodelSchema, { toJSON: { virtuals: true } });
  13. schema.index({ id: 1 });
  14. schema.plugin(metaPlugin);
  15. module.exports = app => {
  16. const { mongoose } = app;
  17. return mongoose.model('Trainmodel', schema, 'trainmodel');
  18. };