experts.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const { Secret } = require('naf-framework-mongoose/lib/model/schema');
  5. // 专家表
  6. const ExpertsSchema = {
  7. name: { type: String, required: true, maxLength: 200 }, // 姓名
  8. imgpath: { type: String, required: false, maxLength: 500 }, // 头像图片路径
  9. gender: { type: String, required: false, maxLength: 200 }, // 性别
  10. nation: { type: String, required: false, maxLength: 200 }, // 民族
  11. birth: { type: String, required: false, maxLength: 200 }, // 出生年月
  12. cardtype: { type: String, required: false, maxLength: 500 }, // 证件类型
  13. cardnumber: { type: String, required: false, maxLength: 500 }, // 身份证号
  14. technical: { type: String, required: false, maxLength: 500 }, // 初级职称
  15. technical_actual: { type: String, required: false, maxLength: 500 }, // 具体职称
  16. position: { type: String, required: false, maxLength: 200 }, // 职务
  17. school: { type: String, required: false, maxLength: 200 }, // 毕业院校
  18. eduback: { type: String, required: false, maxLength: 200 }, // 学历
  19. degree: { type: String, required: false, maxLength: 200 }, // 学位
  20. major_studied: { type: String, required: false, maxLength: 500 }, // 所学专业
  21. professional: { type: String, required: false, maxLength: 500 }, // 从事专业
  22. email: { type: String, required: false, maxLength: 500 }, // 邮箱
  23. tel: { type: String, required: false, maxLength: 200 }, // 办公电话
  24. phone: { type: String, required: false, maxLength: 200 }, // 手机号
  25. job_profile: { type: String, required: false }, // 业务工作简介
  26. project_profile: { type: String, required: false }, // 主持或参与项目情况
  27. achievement: { type: String, required: false }, // 主要学术成就及获奖情况
  28. paper: { type: String, required: false }, // 论文论著
  29. remark: { type: String, required: false }, // 备注
  30. field: { type: String, required: false, maxLength: 200 }, // 可供咨询领域
  31. field_py: { type: String, required: false, maxLength: 200 }, // 领域拼音
  32. is_del: { type: String, required: false, maxLength: 200 }, // 是否删除,0-否,1-是
  33. };
  34. const schema = new Schema(ExpertsSchema, { toJSON: { virtuals: true } });
  35. schema.index({ id: 1 });
  36. schema.plugin(metaPlugin);
  37. module.exports = app => {
  38. const { mongoose } = app;
  39. return mongoose.model('Experts', schema, 'talent_experts');
  40. }
  41. ;