uploadtask.js 1.0 KB

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 学生上传作业表
  5. const UploadtaskSchema = {
  6. termid: { type: String, required: true, maxLength: 200 }, // 期id
  7. batchid: { type: String, required: true, maxLength: 200 }, // 批次id
  8. classid: { type: String, required: true, maxLength: 200 }, // 班级id
  9. lessonid: { type: String, required: true, maxLength: 200 }, // 课程信息id
  10. studentid: { type: String, required: true, maxLength: 200 }, // 学生id
  11. picrul: { type: String, required: false, maxLength: 200 }, // 上传图片地址
  12. taskid: { type: String, required: false, maxLength: 200 }, // 作业id
  13. score: { type: String, required: false, maxLength: 2000 }, // 分数
  14. };
  15. const schema = new Schema(UploadtaskSchema, { toJSON: { virtuals: true } });
  16. schema.index({ id: 1 });
  17. schema.plugin(metaPlugin);
  18. module.exports = app => {
  19. const { mongoose } = app;
  20. return mongoose.model('Uploadtask', schema, 'uploadtask');
  21. };