lookrecord.js 895 B

123456789101112131415161718192021
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const LookrecordSchema = {
  5. roomid: { type: String, required: false, maxLength: 200 }, // 房间名称
  6. roomname: { type: String, required: false, maxLength: 200 }, // 房间号
  7. userid: { type: String, required: false, maxLength: 200 }, // 观看用户id
  8. username: { type: String, required: false, maxLength: 200 }, // 观看用户名称
  9. createtime: { type: String, required: false, maxLength: 200 }, // 创建时间
  10. type: { type: String, required: false, maxLength: 200 }, // 0、进入 1、退出
  11. };
  12. const schema = new Schema(LookrecordSchema, { toJSON: { virtuals: true } });
  13. schema.index({ id: 1 });
  14. schema.plugin(metaPlugin);
  15. module.exports = app => {
  16. const { mongoose } = app;
  17. return mongoose.model('Lookrecord', schema, 'lookrecord');
  18. };