12345678910111213141516171819202122 |
- '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 patentexamine = {
- to: { type: ObjectId }, // 接收人
- content: { type: String }, // 内容
- is_read: { type: Boolean, default: false }, // 是否已读
- remark: { type: String },
- };
- const schema = new Schema(patentexamine, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ to: 1 });
- schema.index({ is_read: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Patentexamine', schema, 'patent_examine');
- };
|