123456789101112131415161718192021222324252627 |
- '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 patentassess = {
- user_id: { type: ObjectId }, // 用户id
- patent_id: { type: ObjectId }, // 专利id
- patent_name: { type: String }, // 专利名称
- is_money: { type: Boolean, default: false }, // 是否缴费
- expert: { type: Array }, // 专家
- report: { type: String }, // 评估报告
- status: { type: String }, // 状态
- remark: { type: String },
- };
- const schema = new Schema(patentassess, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ user_id: 1 });
- schema.index({ patent_id: 1 });
- schema.index({ is_money: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Patentassess', schema, 'patent_assess');
- };
|