Content.js 772 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. 'use strict';
  2. module.exports = app => {
  3. const { mongoose } = app;
  4. const { Schema } = mongoose;
  5. const ContentSchema = new Schema({
  6. // 标题
  7. title: {
  8. type: String,
  9. },
  10. // 短标题
  11. shortTitle: {
  12. type: String,
  13. },
  14. // 摘要
  15. slug: {
  16. type: String,
  17. },
  18. // 缩略图
  19. thumbnail: {
  20. tyoe: String,
  21. },
  22. // 附件
  23. annex: {
  24. type: String,
  25. },
  26. // 内容
  27. content: {
  28. type: Array,
  29. },
  30. // 创建时间
  31. createAt: {
  32. type: String,
  33. },
  34. // 置顶
  35. istop: {
  36. type: Number,
  37. },
  38. // 数据id
  39. id: {
  40. type: String,
  41. },
  42. // 绑定栏目组
  43. columnList: {
  44. type: Array,
  45. },
  46. });
  47. return mongoose.model('Content', ContentSchema);
  48. };