123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 'use strict';
- module.exports = app => {
- const { mongoose } = app;
- const { Schema } = mongoose;
- const ContentSchema = new Schema({
- // 标题
- title: {
- type: String,
- },
- // 摘要
- slug: {
- type: String,
- },
- // 缩略图
- thumbnail: {
- type: String,
- },
- // 附件
- annex: {
- type: String,
- },
- // 缩略图
- annexname: {
- type: String,
- },
- // 内容
- content: {
- type: String,
- },
- // 创建时间
- createAt: {
- type: String,
- },
- // 置顶
- istop: {
- type: Number,
- },
- // 数据id
- id: {
- type: String,
- },
- // 绑定菜单组
- menus: {
- type: String,
- },
- // 绑定栏目
- columns: {
- type: Array,
- },
- // 文章年
- year: {
- type: String,
- },
- // 文章日期
- date: {
- type: String,
- },
- // 访问量
- hits: {
- type: Number,
- default: 0,
- },
- // 第多少期
- term: {
- type: String,
- },
- // 排序
- sort: {
- type: Number,
- default: 0,
- },
- contentType: {
- type: Number,
- default: 0,
- },
- href: {
- type: String,
- },
- });
- return mongoose.model('Content', ContentSchema);
- };
|