1234567891011121314151617181920212223242526 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const RoomUserSchema = {
- name: { type: String, required: false, maxLength: 200 }, // 名称
- phone: { type: String, required: true, maxLength: 64 }, // 手机
- passwd: { type: String, select: false }, // 注册密码
- openid: { type: String, required: false }, // 微信openid
- role: { type: String, required: false }, // 3-主播 4、房间用户
- hosname: { type: String, required: false }, // 医院名称
- deptname: { type: String, required: false }, // 机构名称
- level: { type: String, required: false }, // 职务
- title: { type: String, required: false }, // 个人简介
- remark: { type: String, required: false }, // 备注
- };
- const schema = new Schema(RoomUserSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Roomuser', schema, 'room_user');
- };
|