lookuser.js 1.3 KB

123456789101112131415161718192021222324252627
  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. hosname: { type: String, required: false }, // 医院名称
  14. deptname: { type: String, required: false }, // 机构名称
  15. level: { type: String, required: false }, // 职务
  16. major: { type: String, required: false }, // 专业
  17. };
  18. const schema = new Schema(LookuserSchema, { toJSON: { virtuals: true } });
  19. schema.index({ id: 1 });
  20. schema.plugin(metaPlugin);
  21. module.exports = app => {
  22. const { mongoose } = app;
  23. return mongoose.model('Lookuser', schema, 'lookuser');
  24. };