praise.js 359 B

12345678910111213
  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. const schema = new Schema(SchemaDefine);
  10. module.exports = app => {
  11. const { mongoose } = app;
  12. return mongoose.model('praise', schema, 'praise');
  13. };