trainmodel.js 939 B

1234567891011121314151617181920212223
  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. stunum: { type: String, required: false, maxLength: 200 }, // 默认每班学生数
  12. };
  13. const schema = new Schema(TrainmodelSchema, { toJSON: { virtuals: true } });
  14. schema.index({ id: 1 });
  15. schema.plugin(metaPlugin);
  16. module.exports = app => {
  17. const { mongoose } = app;
  18. return mongoose.model('Trainmodel', schema, 'trainmodel');
  19. };