job.js 1.4 KB

123456789101112131415161718192021222324252627282930
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 任务表
  5. const JobSchema = {
  6. code: { type: String, required: false, maxLength: 200 }, // 学校代码
  7. name: { type: String, required: false, maxLength: 500 }, // 学校名称
  8. planid: { type: String, required: false, maxLength: 200 }, // 计划id
  9. termid: { type: String, required: false, maxLength: 200 }, // 期id
  10. term: { type: String, required: false, maxLength: 500 }, // 期名称
  11. batchid: { type: String, required: false, maxLength: 200 }, // 批次id
  12. filepath: { type: String, required: false, maxLength: 500 }, // 文件地址
  13. studs: { type: String, required: false }, // 学生数据
  14. plannum: { type: String, required: false, maxLength: 20 }, // 计划人数
  15. schnum: { type: String, required: false, maxLength: 20 }, // 学校上传人数
  16. isstore: { type: String, required: false, maxLength: 20 }, // 是否入库 0、不入库1、入库
  17. createtime: { type: String, required: false, maxLength: 200 }, // 上传时间
  18. reason: { type: String, required: false }, // 原因
  19. type: { type: String, required: false, maxLength: 200 }, // 类型 0、普通 1、特殊
  20. };
  21. const schema = new Schema(JobSchema, { toJSON: { virtuals: true } });
  22. schema.index({ id: 1 });
  23. schema.plugin(metaPlugin);
  24. module.exports = app => {
  25. const { mongoose } = app;
  26. return mongoose.model('Job', schema, 'job');
  27. };