|
@@ -1,27 +1,18 @@
|
|
|
'use strict';
|
|
|
const Schema = require('mongoose').Schema;
|
|
|
+const moment = require('moment');
|
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
const { Secret } = require('naf-framework-mongoose/lib/model/schema');
|
|
|
-// 产品图片表
|
|
|
-const videos = new Schema({
|
|
|
- name: { type: String, required: false, maxLength: 200 }, // 视频标题
|
|
|
- start_time: { type: String, required: false, maxLength: 200 }, // 开始时间
|
|
|
- end_time: { type: String, required: false, maxLength: 200 }, // 结束时间
|
|
|
- url: { type: String, required: false, maxLength: 500 }, // 视频路径
|
|
|
-});
|
|
|
|
|
|
const Channel = {
|
|
|
user_id: { type: String, required: false, maxLength: 200 }, // 创建人id
|
|
|
title: { type: String, required: false, maxLength: 200 }, // 标题
|
|
|
- province: { type: String, required: false }, // 省
|
|
|
- place: { type: String, required: false }, // 市
|
|
|
orgin: { type: String, required: false, maxLength: 200 }, // 来源
|
|
|
- sponsor: { type: String, required: false, maxLength: 200 }, // 主办方
|
|
|
- organizer: { type: String, required: false, maxLength: 200 }, // 承办方
|
|
|
+ type: { type: String, required: false, maxLength: 200 }, // 类别
|
|
|
+ room_id: { type: String, required: false, maxLength: 200 }, // 房间id,服务生成,从2001开始
|
|
|
+ passwd: { type: Secret, required: false, maxLength: 200, select: false }, // 密码,房间号
|
|
|
desc: { type: String, maxLength: 1000 }, // 简介
|
|
|
- create_time: { type: String, required: false, maxLength: 200 }, // 创建时间
|
|
|
- image_path: { type: String, required: false }, // 图片路径
|
|
|
- videodata: { type: [ videos ], default: [] }, // vip用户
|
|
|
+ create_time: { type: String, required: false, maxLength: 200, default: moment().format('YYYY-MM-DD HH:ss') }, // 创建时间
|
|
|
};
|
|
|
const schema = new Schema(Channel, { toJSON: { virtuals: true } });
|
|
|
schema.index({ id: 1 });
|