message.js 968 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * 消息通知数据模型
  3. *
  4. * @author CaiAoLin
  5. * @date 2017/9/21
  6. * @version
  7. */
  8. const mongoose = require('mongoose');
  9. let Schema = mongoose.Schema;
  10. let collectionName = 'message';
  11. let modelSchema = {
  12. // 消息标题
  13. title: String,
  14. // 消息内容
  15. content: String,
  16. // 消息类型
  17. message_type: {
  18. type: Number,
  19. default: 1
  20. },
  21. // 消息状态
  22. status: {
  23. type: Number,
  24. default: 0
  25. },
  26. // 发布时间
  27. release_time: {
  28. type: Number,
  29. default: 0
  30. },
  31. // 创建时间
  32. create_time: Number,
  33. // 最后修改时间
  34. update_time: {
  35. type: Number,
  36. default: 0
  37. },
  38. // 创建者
  39. creator: String,
  40. // 发布者
  41. release_user: String,
  42. // 最后修改人
  43. last_update: {
  44. type: String,
  45. default: ''
  46. }
  47. };
  48. mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));