discuss.js 572 B

12345678910111213141516171819
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const SchemaDefine = {
  4. // 文章或杂志ID
  5. source: { type: String, required: true },
  6. // 用户ID
  7. target: { type: String, required: true },
  8. // 留言信息
  9. msg: { type: String, required: true },
  10. // 父级id
  11. parentId: { type: String, required: true },
  12. // 状态 0=待审核 1=已发布 2=已驳回
  13. status: { type: String, required: true },
  14. };
  15. const schema = new Schema(SchemaDefine);
  16. module.exports = app => {
  17. const { mongoose } = app;
  18. return mongoose.model('discuss', schema, 'discuss');
  19. };