|
@@ -0,0 +1,36 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
+
|
|
|
+// 专家基本信息表
|
|
|
+const ExpertSchema = {
|
|
|
+ name: { type: String, required: true, maxLength: 200 }, // 专家姓名
|
|
|
+ gender: { type: String, required: false, maxLength: 200 }, // 性别
|
|
|
+ id_number: { type: String, required: false, maxLength: 500 }, // 身份证号
|
|
|
+ phone: { type: String, required: true, maxLength: 200 }, // 电话号码
|
|
|
+ email: { type: String, required: false, maxLength: 200 }, // 邮箱
|
|
|
+ address: { type: String, required: false, maxLength: 500 }, // 地址
|
|
|
+ img_url: { 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 }, // 院校
|
|
|
+ education: { type: String, required: false, maxLength: 200 }, // 学历
|
|
|
+ degree: { type: String, required: false, maxLength: 200 }, // 学位
|
|
|
+ major: { type: String, required: false, maxLength: 200 }, // 专业
|
|
|
+ profession: { 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 }, // 学术成就
|
|
|
+ status: { type: String, required: false, default: "0", maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝
|
|
|
+};
|
|
|
+
|
|
|
+const schema = new Schema(ExpertSchema, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Expert', schema, 'expert');
|
|
|
+};
|