|
@@ -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 },
|
|
|
+};
|
|
|
+
|
|
|
+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');
|
|
|
+};
|