|
@@ -0,0 +1,38 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
|
|
|
+
|
|
|
+// 专利申请
|
|
|
+const apply = {
|
|
|
+ mech_id: { type: String, required: false }, // 机构id
|
|
|
+ mech_name: { type: String, required: false }, // 机构名称
|
|
|
+ name: { type: String, required: false }, // 专利名称
|
|
|
+ user_id: { type: String, required: false }, // 申请人id
|
|
|
+ user_name: { type: String, required: false }, // 申请人姓名
|
|
|
+ type: { type: String, required: false }, // 专利类型
|
|
|
+ inventor: { type: String, required: false }, // 发明人
|
|
|
+ contact: { type: String, required: false }, // 技术联系人
|
|
|
+ phone: { type: String, required: false }, // 联系电话
|
|
|
+ email: { type: String, required: false }, // 电子邮箱
|
|
|
+ check_url: { type: String, required: false }, // 审查文件
|
|
|
+ apply_url: { type: String, required: false }, // 申请文件
|
|
|
+ questions: { type: String, required: false }, // 其他内容合集
|
|
|
+ status: { type: String, required: false }, // 状态
|
|
|
+};
|
|
|
+const schema = new Schema(apply, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
|
+schema.index({ mech_id: 1 });
|
|
|
+schema.index({ mech_name: 1 });
|
|
|
+schema.index({ name: 1 });
|
|
|
+schema.index({ user_id: 1 });
|
|
|
+schema.index({ user_name: 1 });
|
|
|
+schema.index({ type: 1 });
|
|
|
+schema.index({ phone: 1 });
|
|
|
+schema.index({ status: 1 });
|
|
|
+
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Apply', schema, 'apply');
|
|
|
+};
|