'use strict'; const Schema = require('mongoose').Schema; const SchemaDefine = { // 文章或杂志ID source: { type: String, required: true }, // 用户ID target: { type: String, required: true }, }; const schema = new Schema(SchemaDefine); module.exports = app => { const { mongoose } = app; return mongoose.model('praise', schema, 'praise'); };