|
@@ -0,0 +1,41 @@
|
|
|
+'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-拒绝
|
|
|
+};
|
|
|
+
|
|
|
+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');
|
|
|
+};
|