123456789101112131415161718192021 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const moment = require('moment');
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- const { ObjectId } = require('mongoose').Types;
- // 设置表
- const setting = {
- name: { type: String }, // 本馆名称
- time: { type: Array }, // 营业时间
- images: { type: Array }, // 宣传图
- brief: { type: String }, // 简介
- remark: { type: String },
- };
- const schema = new Schema(setting, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.index({ 'meta.createdAt': 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Setting', schema, 'setting');
- };
|