|
@@ -0,0 +1,29 @@
|
|
|
+
|
|
|
+ * 求职信
|
|
|
+ */
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
+
|
|
|
+
|
|
|
+const SchemaDefine = {
|
|
|
+ post_id: { type: String, require: true },
|
|
|
+ resume_id: { type: String, require: true },
|
|
|
+ studname: { type: String, required: true, maxLength: 64 },
|
|
|
+ corpname: { type: String, required: true, maxLength: 128 },
|
|
|
+ title: { type: String, required: true, maxLength: 128 },
|
|
|
+ status: { type: String, default: '0' },
|
|
|
+ type: { type: String, default: '0' },
|
|
|
+ origin: { type: String, require: false },
|
|
|
+ remark: { type: String, required: false, maxLength: 256 },
|
|
|
+};
|
|
|
+const schema = new Schema(SchemaDefine, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ post_id: 1 });
|
|
|
+schema.index({ resume_id: 1 });
|
|
|
+schema.index({ post_id: 1, resume_id: 1 }, { unique: true });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('JobsMsg', schema, 'jobs_msg');
|
|
|
+};
|