expert.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 专家基本信息表
  5. const ExpertSchema = {
  6. name: { type: String, required: true, maxLength: 200 }, // 专家姓名
  7. gender: { type: String, required: false, maxLength: 200 }, // 性别
  8. id_number: { type: String, required: false, maxLength: 500 }, // 身份证号
  9. phone: { type: String, required: true, maxLength: 200 }, // 电话号码
  10. email: { type: String, required: false, maxLength: 200 }, // 邮箱
  11. address: { type: String, required: false, maxLength: 500 }, // 地址
  12. img_url: { type: String, required: false }, // 头像图片
  13. birthday: { type: String, required: false, maxLength: 20 }, // 出生日期
  14. level: { type: String, required: false, maxLength: 200 }, // 职称级别
  15. levelname: { type: String, required: false, maxLength: 200 }, // 职称名称
  16. position: { type: String, required: false, maxLength: 200 }, // 职务
  17. school: { type: String, required: false, maxLength: 200 }, // 院校
  18. education: { type: String, required: false, maxLength: 200 }, // 学历
  19. degree: { type: String, required: false, maxLength: 200 }, // 学位
  20. major: { type: String, required: false, maxLength: 200 }, // 专业
  21. profession: { type: String, required: false, maxLength: 200 }, // 从事专业
  22. resume: { type: String, required: false, maxLength: 5000 }, // 工作简历
  23. project: { type: String, required: false, maxLength: 5000 }, // 项目
  24. academic: { type: String, required: false, maxLength: 5000 }, // 学术成就
  25. status: { type: String, required: false, default: "0", maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝
  26. };
  27. const schema = new Schema(ExpertSchema, { toJSON: { virtuals: true } });
  28. schema.index({ id: 1 });
  29. schema.plugin(metaPlugin);
  30. module.exports = app => {
  31. const { mongoose } = app;
  32. return mongoose.model('Expert', schema, 'expert');
  33. };