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