'use strict'; const Schema = require('mongoose').Schema; const SchemaDefine = { // 排序 date: { type: Number, required: false, default: 0 }, // 添加时间 createAt: { type: Number, required: true }, // 修改时间 updateAt: { type: Number, required: true }, // 图片 img: { type: String, required: true }, // 绑定类型 bind: { type: String, required: true }, // 类型 type: { type: Number, required: true }, // 1 = 栏目 2 = 单页 0 = 链接 // 链接地址 url: { type: String, required: false }, // 绑定栏目 column: { type: String, required: false }, // 绑定单页 pages: { type: String, required: false }, // 名称 title: { type: String, required: false }, }; const schema = new Schema(SchemaDefine); module.exports = app => { const { mongoose } = app; return mongoose.model('imgnews', schema, 'imgnews'); };