Content.js 895 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. type: String,
  21. },
  22. // 附件
  23. annex: {
  24. type: String,
  25. },
  26. annexname: {
  27. type: String,
  28. },
  29. // 内容
  30. content: {
  31. type: String,
  32. },
  33. // 创建时间
  34. createAt: {
  35. type: String,
  36. },
  37. // 置顶
  38. istop: {
  39. type: Number,
  40. },
  41. // 数据id
  42. id: {
  43. type: String,
  44. },
  45. // 绑定栏目组
  46. columnList: {
  47. type: Array,
  48. },
  49. year: {
  50. type: String,
  51. },
  52. date: {
  53. type: String,
  54. },
  55. });
  56. return mongoose.model('Content', ContentSchema);
  57. };