|
@@ -0,0 +1,21 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
+
|
|
|
+const LookrecordSchema = {
|
|
|
+ roomid: { type: String, required: false, maxLength: 200 }, // 房间名称
|
|
|
+ roomname: { type: String, required: false, maxLength: 200 }, // 房间号
|
|
|
+ userid: { type: String, required: false, maxLength: 200 }, // 观看用户id
|
|
|
+ username: { type: String, required: false, maxLength: 200 }, // 观看用户名称
|
|
|
+ createtime: { type: String, required: false, maxLength: 200 }, // 创建时间
|
|
|
+ type: { type: String, required: false, maxLength: 200 }, // 0、进入 1、退出
|
|
|
+};
|
|
|
+
|
|
|
+const schema = new Schema(LookrecordSchema, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Lookrecord', schema, 'lookrecord');
|
|
|
+};
|