'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); // 任务表 const JobSchema = { code: { type: String, required: false, maxLength: 200 }, // 学校代码 name: { type: String, required: false, maxLength: 500 }, // 学校名称 planid: { type: String, required: false, maxLength: 200 }, // 计划id termid: { type: String, required: false, maxLength: 200 }, // 期id term: { type: String, required: false, maxLength: 500 }, // 期名称 batchid: { type: String, required: false, maxLength: 200 }, // 批次id filepath: { type: String, required: false, maxLength: 500 }, // 文件地址 studs: { type: String, required: false }, // 学生数据 plannum: { type: String, required: false, maxLength: 20 }, // 计划人数 schnum: { type: String, required: false, maxLength: 20 }, // 学校上传人数 isstore: { type: String, required: false, maxLength: 20 }, // 是否入库 0、不入库1、入库 createtime: { type: String, required: false, maxLength: 200 }, // 上传时间 reason: { type: String, required: false }, // 原因 type: { type: String, required: false, maxLength: 200 }, // 类型 0、普通 1、特殊 }; const schema = new Schema(JobSchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Job', schema, 'job'); };