cpcimporterror.js 801 B

12345678910111213141516171819202122
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 交底书表
  5. const cpcimporterror = {
  6. key: { type: String }, // 专利信息
  7. name: { type: String }, // 专利信息名称
  8. create_number: { type: String }, //专利号
  9. word: { type: String }, // 错误信息
  10. filepath: { type: String }, // 导入的zip包路径(绝对)
  11. time: { type: String }, // 时间
  12. };
  13. const schema = new Schema(cpcimporterror, { toJSON: { virtuals: true } });
  14. schema.index({ id: 1 });
  15. schema.index({ key: 1 });
  16. schema.index({ time: 1 });
  17. schema.index({ 'meta.createdAt': 1 });
  18. schema.plugin(metaPlugin);
  19. module.exports = (app) => {
  20. const { mongoose } = app;
  21. return mongoose.model('Cpcimporterror', schema, 'cpcimporterror');
  22. };