12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- '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 user = new Schema(
- {
- user_id: { type: ObjectId, required: false, maxLength: 500 }, // 名称,
- name: { type: String, required: false, maxLength: 500 }, // 链接地址,
- }
- );
- // 专利信息表
- 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: [ user ] }, // 发明人
- 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: Array }, // 图片
- origin: { type: String }, // 数据来源(手写的)
- user_id: { type: [ ObjectId ] },
- status: { type: String, required: false, default: '0' }, // 状态
- trans_status: { type: String, required: false, default: '0' }, // 交易状态
- // 数据新增属性2021-09-06
- nationality: { type: String }, // 公开国别
- ipc_type: { type: String }, // ipc主分类
- onlegal_status: { type: String }, // 当前法律状态
- legal_status: { type: String }, // 法律状态
- law_date: { type: String }, // 法律文书日期
- on_obligee: { type: String }, // 当前权利人
- apply_address: { type: String }, // 申请人地址(其他)
- apply_other: { type: String }, // 申请人(其他)
- law_num: { type: String }, // 法律文书编号
- first_opendate: { type: String }, // 首次公开日
- empower_date: { type: String }, // 授权公告日
- lose_date: { type: String }, // 失效日
- examine_date: { type: String }, // 实际审查失效日
- invention_design: { type: String }, // 发明人(设计)其他
- };
- const schema = new Schema(patentinfo, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ create_number: 1 });
- schema.index({ create_date: 1 });
- schema.index({ success_number: 1 });
- schema.index({ success_date: 1 });
- schema.index({ name: 1 });
- schema.index({ inventor: 1 });
- schema.index({ address: 1 });
- schema.index({ apply_personal: 1 });
- schema.index({ term: 1 });
- schema.index({ type: 1 });
- schema.index({ agent_personal: 1 });
- schema.index({ agent: 1 });
- schema.index({ origin: 1 });
- schema.index({ status: 1 });
- schema.index({ trans_status: 1 });
- schema.index({ nationality: 1 });
- schema.index({ ipc_type: 1 });
- schema.index({ onlegal_status: 1 });
- schema.index({ law_date: 1 });
- schema.index({ on_obligee: 1 });
- schema.index({ law_num: 1 });
- schema.index({ first_opendate: 1 });
- schema.index({ empower_date: 1 });
- schema.index({ lose_date: 1 });
- schema.index({ examine_date: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Patentinfo', schema, 'patent_info');
- };
|