'use strict'; const Schema = require('mongoose').Schema; const SchemaDefine = { // 内容 content: { type: String, required: true }, // 标题 name: { type: String, required: true }, // 描述 describe: { type: String, required: true }, // 状态 status: { type: String, required: true }, // 文件路经 url: { type: String, required: false }, // 发布时间 date: { type: Number, required: true }, // 期刊栏目 column: { type: String, required: false }, // 绑定栏目ID bind: { type: String, required: true }, }; const schema = new Schema(SchemaDefine); module.exports = app => { const { mongoose } = app; return mongoose.model('catalogue', schema, 'catalogue'); };