'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin'); // 联系客服 const serviceContact = { phone: { type: String, required: false, zh: '联系电话' }, // wx: { type: String, required: false, zh: '微信' }, // qq: { type: String, required: false, zh: 'QQ' }, // email: { type: String, required: false, zh: '邮箱' }, // }; const schema = new Schema(serviceContact, { toJSON: { getters: true, virtuals: true } }); schema.index({ id: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('ServiceContact ', schema, 'serviceContact '); };