patentexamine.js 771 B

12345678910111213141516171819202122
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  5. const { ObjectId } = require('mongoose').Types;
  6. // 审核通知
  7. const patentexamine = {
  8. to: { type: ObjectId }, // 接收人
  9. content: { type: String }, // 内容
  10. is_read: { type: Boolean, default: false }, // 是否已读
  11. remark: { type: String },
  12. };
  13. const schema = new Schema(patentexamine, { toJSON: { virtuals: true } });
  14. schema.index({ id: 1 });
  15. schema.index({ to: 1 });
  16. schema.index({ is_read: 1 });
  17. schema.index({ 'meta.createdAt': 1 });
  18. schema.plugin(metaPlugin);
  19. module.exports = app => {
  20. const { mongoose } = app;
  21. return mongoose.model('Patentexamine', schema, 'patent_examine');
  22. };