|
@@ -0,0 +1,22 @@
|
|
|
|
+'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 }, // 默认批次下生成的班级数
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+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');
|
|
|
|
+};
|