trainvideo.js 1008 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 课程培训表
  5. const TrainVideoSchema = {
  6. url: { type: String, required: true, maxLength: 200 }, // 视频地址
  7. subid: { type: String, required: true, maxLength: 200 }, // 科目id
  8. teacher: { type: String, required: true, maxLength: 200 }, // 教师姓名
  9. teacherid: { type: String, required: true, maxLength: 200 }, // 教师id
  10. status: { type: String, required: false, maxLength: 200, default: '0' }, // 状态:0=>未审核;1=>审核通过(中心直接传来,通过);2=>审核失败
  11. touser: { type: String, required: false, maxLength: 20 }, // 面向对象:0=>所有人;1=>教师;2=>学生;3=>班主任
  12. };
  13. const schema = new Schema(TrainVideoSchema, { toJSON: { virtuals: true } });
  14. schema.index({ id: 1 });
  15. schema.plugin(metaPlugin);
  16. module.exports = app => {
  17. const { mongoose } = app;
  18. return mongoose.model('Trainvideo', schema, 'trainvideo');
  19. };