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 ExpertsSchema = {
- name: { type: String, required: true, maxLength: 200 }, // 姓名
- imgpath: { type: String, required: false, maxLength: 500 }, // 头像图片路径
- gender: { type: String, required: false, maxLength: 200 }, // 性别
- nation: { type: String, required: false, maxLength: 200 }, // 民族
- birth: { type: String, required: false, maxLength: 200 }, // 出生年月
- cardtype: { type: String, required: false, maxLength: 500 }, // 证件类型
- cardnumber: { type: String, required: false, maxLength: 500 }, // 身份证号
- technical: { type: String, required: false, maxLength: 500 }, // 初级职称
- technical_actual: { type: String, required: false, maxLength: 500 }, // 具体职称
- position: { type: String, required: false, maxLength: 200 }, // 职务
- school: { type: String, required: false, maxLength: 200 }, // 毕业院校
- eduback: { type: String, required: false, maxLength: 200 }, // 学历
- degree: { type: String, required: false, maxLength: 200 }, // 学位
- major_studied: { type: String, required: false, maxLength: 500 }, // 所学专业
- professional: { type: String, required: false, maxLength: 500 }, // 从事专业
- email: { type: String, required: false, maxLength: 500 }, // 邮箱
- tel: { type: String, required: false, maxLength: 200 }, // 办公电话
- phone: { type: String, required: false, maxLength: 200 }, // 手机号
- job_profile: { type: String, required: false }, // 业务工作简介
- project_profile: { type: String, required: false }, // 主持或参与项目情况
- achievement: { type: String, required: false }, // 主要学术成就及获奖情况
- paper: { type: String, required: false }, // 论文论著
- remark: { type: String, required: false }, // 备注
- field: { type: String, required: false, maxLength: 200 }, // 可供咨询领域
- field_py: { type: String, required: false, maxLength: 200 }, // 领域拼音
- is_del: { type: String, required: false, maxLength: 200 }, // 是否删除,0-否,1-是
- };
- const schema = new Schema(ExpertsSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Experts', schema, 'talent_experts');
- }
- ;
|