123456789101112131415161718192021222324 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 全年计划模板表
- const TrainmodelSchema = {
- total: { type: String, required: false, maxLength: 200 }, // 总人数
- day: { type: String, required: false, maxLength: 200 }, // 课程所需天数
- color: { type: [ String ], required: false }, // 默认颜色
- batchnum: { type: String, required: false, maxLength: 200 }, // 默认期下生成的批次数
- classnum: { type: String, required: false, maxLength: 200 }, // 默认批次下生成的班级数
- stunum: { type: String, required: false, maxLength: 200 }, // 默认每班学生数
- carpnum: { type: String, required: false, maxLength: 200 }, // 默认每辆车的学生数
- };
- const schema = new Schema(TrainmodelSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Trainmodel', schema, 'trainmodel');
- };
|