lookuser.js 1.0 KB

1234567891011121314151617181920212223
  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. phone: { type: String, required: false, maxLength: 200 }, // 手机号
  10. switchrole: { type: String, required: false }, // 直播身份 ‘anchor’ 主播 ‘audience’ 观众
  11. createtime: { type: String, required: false, maxLength: 200 }, // 创建时间
  12. isxf: { type: String, required: false, maxLength: 200 }, // 申请学分
  13. };
  14. const schema = new Schema(LookuserSchema, { toJSON: { virtuals: true } });
  15. schema.index({ id: 1 });
  16. schema.plugin(metaPlugin);
  17. module.exports = app => {
  18. const { mongoose } = app;
  19. return mongoose.model('Lookuser', schema, 'lookuser');
  20. };