1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const SchemaDefine = {
- // 置顶
- istop: { type: Boolean, required: false, default: false },
- // 排序 发布时间
- date: { type: Number, required: false },
- // 添加时间
- createAt: { type: Number, required: true },
- // 修改时间
- updateAt: { type: Number, required: true },
- // 缩略图
- thumbnail: { type: String, required: false },
- // 标题
- title: { type: String, required: true },
- // 描述
- describe: { type: String, required: true },
- // 内容
- content: { type: String, required: true },
- // 绑定栏目
- bind: { type: String, required: true },
- // 访问量
- visit: { type: Number, required: false, default: 0 },
- // 推荐
- recommend: { type: Boolean, required: false, default: false },
- // 附件
- annex: { type: String, required: false },
- // vip可见标识
- svip: { type: Boolean, required: false },
- // 是否显示
- isShow: { type: Boolean, required: false },
- // 状态 0=待发布 1=已发布
- status: { type: String, required: false },
- // 关键词
- keywords: { type: Array, required: false, default: [] },
- };
- const schema = new Schema(SchemaDefine);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('content', schema, 'content');
- };
|