lookuser.js 722 B

12345678910111213141516171819
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const LookuserSchema = {
  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. };
  10. const schema = new Schema(LookuserSchema, { toJSON: { virtuals: true } });
  11. schema.index({ id: 1 });
  12. schema.plugin(metaPlugin);
  13. module.exports = app => {
  14. const { mongoose } = app;
  15. return mongoose.model('Lookuser', schema, 'lookuser');
  16. };