123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const { Secret } = require('naf-framework-mongoose/lib/model/schema');
- // 专家基本信息表
- const ExpertsuserSchema = {
- name: { type: String, required: true, maxLength: 200 }, // 专家姓名
- gender: { type: String, required: false, maxLength: 200 }, // 性别
- password: { type: Secret, required: false, select: false }, // 登录密码
- cardnumber: { type: String, required: false, maxLength: 500 }, // 身份证号
- phone: { type: String, required: true, maxLength: 200 }, // 电话号码
- email: { type: String, required: false, maxLength: 200 }, // 邮箱
- addr: { type: String, required: false, maxLength: 500 }, // 地址
- img_path: { type: String, required: false }, // 头像图片
- birthday: { type: String, required: false, maxLength: 20 }, // 出生日期
- level: { type: String, required: false, maxLength: 200 }, // 职称级别
- levelname: { type: String, required: false, maxLength: 200 }, // 职称名称
- position: { type: String, required: false, maxLength: 200 }, // 职务
- school: { type: String, required: false, maxLength: 200 }, // 院校
- xl: { type: String, required: false, maxLength: 200 }, // 学历
- xw: { type: String, required: false, maxLength: 200 }, // 学位
- major: { type: String, required: false, maxLength: 200 }, // 专业
- professional: { type: String, required: false, maxLength: 200 }, // 从事专业
- resume: { type: String, required: false, maxLength: 5000 }, // 工作简历
- project: { type: String, required: false, maxLength: 5000 }, // 项目
- academic: { type: String, required: false, maxLength: 5000 }, // 学术成就
- paper: { type: String, required: false, maxLength: 5000 }, // 论文
- remark: { type: String, required: false, maxLength: 5000 }, // 备注
- role: { type: String, required: false, maxLength: 20 }, // 角色
- status: { type: String, required: false, default: '0', maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝
- pid: { type: String, required: false }, // 父id
- deptname: { type: String, required: false }, // 机构名称
- userid: { type: String, required: false }, // 用户表主键id
- code: { type: String, required: false }, // 邀请码
- };
- const schema = new Schema(ExpertsuserSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Expertsuser', schema, 'experts_user');
- };
|