lookuser.js 1.4 KB

12345678910111213141516171819202122232425262728
  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. isonline: { type: String, required: false, maxLength: 200, default: '0' }, // 是否在线0、不在线 1、在线
  18. };
  19. const schema = new Schema(LookuserSchema, { toJSON: { virtuals: true } });
  20. schema.index({ id: 1 });
  21. schema.plugin(metaPlugin);
  22. module.exports = app => {
  23. const { mongoose } = app;
  24. return mongoose.model('Lookuser', schema, 'lookuser');
  25. };