channelVideo.js 809 B

12345678910111213141516171819
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const ChannelVideo = {
  5. user_id: { type: String, required: false, maxLength: 200 }, // 所属人id,关联channel
  6. title: { type: String, required: false, maxLength: 200 }, // 标题
  7. start_time: { type: String, required: false, maxLength: 200 }, // 开始时间
  8. end_time: { type: String, required: false, maxLength: 200 }, // 结束时间
  9. file_path: { type: String, required: false, maxLength: 200 }, // 视频路径
  10. };
  11. const schema = new Schema(ChannelVideo, { toJSON: { virtuals: true } });
  12. schema.index({ id: 1 });
  13. schema.plugin(metaPlugin);
  14. module.exports = app => {
  15. const { mongoose } = app;
  16. return mongoose.model('ChannelVideo', schema, 'channelVideo');
  17. };