message.js 1002 B

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