|
@@ -2,6 +2,13 @@
|
|
const Schema = require('mongoose').Schema;
|
|
const Schema = require('mongoose').Schema;
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
|
|
|
|
|
+// 房间广告位
|
|
|
|
+const AdvertInfo = {
|
|
|
|
+ title: { type: String, required: false }, // 广告标题
|
|
|
|
+ imgdir: { type: String, required: false }, // 图片地址
|
|
|
|
+ imgurl: { type: String, required: false }, // 图片链接地址
|
|
|
|
+};
|
|
|
|
+
|
|
const RoomSchema = {
|
|
const RoomSchema = {
|
|
name: { type: String, required: false, maxLength: 200 }, // 房间名称
|
|
name: { type: String, required: false, maxLength: 200 }, // 房间名称
|
|
title: { type: String, required: false, maxLength: 200 }, // 标题
|
|
title: { type: String, required: false, maxLength: 200 }, // 标题
|
|
@@ -14,6 +21,7 @@ const RoomSchema = {
|
|
starttime: { type: String, required: false }, // 开始时间
|
|
starttime: { type: String, required: false }, // 开始时间
|
|
endtime: { type: String, required: false }, // 结束时间
|
|
endtime: { type: String, required: false }, // 结束时间
|
|
status: { type: String, required: false, maxLength: 64, default: '0' }, // 状态0、开启1、关闭
|
|
status: { type: String, required: false, maxLength: 64, default: '0' }, // 状态0、开启1、关闭
|
|
|
|
+ adverts: { type: [ AdvertInfo ], required: false, select: true }, // 广告位
|
|
};
|
|
};
|
|
|
|
|
|
const schema = new Schema(RoomSchema, { toJSON: { virtuals: true } });
|
|
const schema = new Schema(RoomSchema, { toJSON: { virtuals: true } });
|