12345678910111213141516171819202122232425262728 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const LookuserSchema = {
- roomid: { type: String, required: false, maxLength: 200 }, // 房间名称
- roomname: { type: String, required: false, maxLength: 200 }, // 房间号
- userid: { type: String, required: false, maxLength: 200 }, // 观看用户id
- username: { type: String, required: false, maxLength: 200 }, // 观看用户名称
- phone: { type: String, required: false, maxLength: 200 }, // 手机号
- switchrole: { type: String, required: false }, // 直播身份 ‘anchor’ 主播 ‘audience’ 观众
- createtime: { type: String, required: false, maxLength: 200 }, // 创建时间
- isxf: { type: String, required: false, maxLength: 200 }, // 申请学分
- hosname: { type: String, required: false }, // 医院名称
- deptname: { type: String, required: false }, // 机构名称
- level: { type: String, required: false }, // 职务
- major: { type: String, required: false }, // 专业
- isonline: { type: String, required: false, maxLength: 200, default: '0' }, // 是否在线0、不在线 1、在线
- };
- const schema = new Schema(LookuserSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Lookuser', schema, 'lookuser');
- };
|