|
@@ -0,0 +1,42 @@
|
|
|
|
+'use strict';
|
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
|
+const moment = require('moment');
|
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
|
+const { ObjectId } = require('mongoose').Types;
|
|
|
|
+// 专利信息表
|
|
|
|
+const patentinfo = {
|
|
|
|
+ create_number: { type: String, required: false }, // 申请号
|
|
|
|
+ create_date: { type: String, required: false }, // 申请日
|
|
|
|
+ success_number: { type: String, required: false }, // 公开(公告)号
|
|
|
|
+ success_date: { type: String, required: false }, // 公开(公告)日
|
|
|
|
+ name: { type: String, required: false }, // 标题
|
|
|
|
+ inventor: { type: String, required: false }, // 发明人
|
|
|
|
+ address: { type: String, required: false }, // 发明人地址
|
|
|
|
+ apply_personal: { type: String, required: false }, // 申请人
|
|
|
|
+ term: { type: String, required: false }, // 专利有效性
|
|
|
|
+ type: { type: String, required: false }, // 专利类型
|
|
|
|
+ agent_personal: { type: String, required: false }, // 代理人
|
|
|
|
+ agent: { type: String, required: false }, // 代理机构
|
|
|
|
+ abstract: { type: String, required: false }, // 摘要
|
|
|
|
+ img_url: { type: String, required: false }, // 图片
|
|
|
|
+ origin: { type: String }, // 数据来源(手写的)
|
|
|
|
+ user_id: { type: [ ObjectId ] },
|
|
|
|
+ status: { type: String, required: false }, // 状态
|
|
|
|
+ trans_status: { type: String, required: false }, // 交易状态
|
|
|
|
+};
|
|
|
|
+const schema = new Schema(patentinfo, { toJSON: { virtuals: true } });
|
|
|
|
+schema.index({ id: 1 });
|
|
|
|
+schema.index({ create_number: 1 });
|
|
|
|
+schema.index({ name: 1 });
|
|
|
|
+schema.index({ inventor: 1 });
|
|
|
|
+schema.index({ apply_personal: 1 });
|
|
|
|
+schema.index({ term: 1 });
|
|
|
|
+schema.index({ type: 1 });
|
|
|
|
+schema.index({ status: 1 });
|
|
|
|
+schema.index({ trans_status: 1 });
|
|
|
|
+schema.index({ 'meta.createdAt': 1 });
|
|
|
|
+schema.plugin(metaPlugin);
|
|
|
|
+module.exports = app => {
|
|
|
|
+ const { mongoose } = app;
|
|
|
|
+ return mongoose.model('Patent_info', schema, 'patent_info');
|
|
|
|
+};
|