job.js 1.4 KB

1234567891011121314151617181920212223242526272829
  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. filepath: { type: String, required: false, maxLength: 500 }, // 文件地址
  12. studs: { type: String, required: false }, // 学生数据
  13. plannum: { type: String, required: false, maxLength: 20 }, // 计划人数
  14. schnum: { type: String, required: false, maxLength: 20 }, // 学校上传人数
  15. isstore: { type: String, required: false, maxLength: 20 }, // 是否入库 0、不入库1、入库
  16. createtime: { type: String, required: false, maxLength: 200 }, // 上传时间
  17. reason: { type: String, required: false }, // 原因
  18. type: { type: String, required: false, maxLength: 200 }, // 类型 0、普通 1、特殊
  19. };
  20. const schema = new Schema(JobSchema, { toJSON: { virtuals: true } });
  21. schema.index({ id: 1 });
  22. schema.plugin(metaPlugin);
  23. module.exports = app => {
  24. const { mongoose } = app;
  25. return mongoose.model('Job', schema, 'job');
  26. };