catalogue.js 710 B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const SchemaDefine = {
  4. // 内容
  5. content: { type: String, required: true },
  6. // 标题
  7. name: { type: String, required: true },
  8. // 描述
  9. describe: { type: String, required: true },
  10. // 状态
  11. status: { type: String, required: true },
  12. // 文件路经
  13. url: { type: String, required: false },
  14. // 发布时间
  15. date: { type: Number, required: true },
  16. // 期刊栏目
  17. column: { type: String, required: false },
  18. // 绑定栏目ID
  19. bind: { type: String, required: true },
  20. };
  21. const schema = new Schema(SchemaDefine);
  22. module.exports = app => {
  23. const { mongoose } = app;
  24. return mongoose.model('catalogue', schema, 'catalogue');
  25. };