Content.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. slug: {
  12. type: String,
  13. },
  14. // 缩略图
  15. thumbnail: {
  16. type: String,
  17. },
  18. // 附件
  19. annex: {
  20. type: String,
  21. },
  22. // 缩略图
  23. annexname: {
  24. type: String,
  25. },
  26. // 内容
  27. content: {
  28. type: String,
  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. menus: {
  44. type: String,
  45. },
  46. // 绑定栏目
  47. columns: {
  48. type: Array,
  49. },
  50. // 文章年
  51. year: {
  52. type: String,
  53. },
  54. // 文章日期
  55. date: {
  56. type: String,
  57. },
  58. // 访问量
  59. hits: {
  60. type: Number,
  61. default: 0,
  62. },
  63. // 第多少期
  64. term: {
  65. type: String,
  66. },
  67. // 排序
  68. sort: {
  69. type: Number,
  70. default: 0,
  71. },
  72. contentType: {
  73. type: Number,
  74. default: 0,
  75. },
  76. href: {
  77. type: String,
  78. },
  79. });
  80. return mongoose.model('Content', ContentSchema);
  81. };