'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); // 站点信息表 const SetSchema = { logourl: { type: String, required: true, maxLength: 500 }, // logo图片路径 content: { type: String, required: true }, // 联系信息 }; const schema = new Schema(SetSchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Set', schema, 'setting_set'); };