1234567891011121314151617181920212223242526272829 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const SchemaDefine = {
- // 排序
- date: { type: Number, required: false },
- // 编码
- code: { type: String, required: true },
- // 名称
- name: { type: String, required: true },
- // 类型
- type: { type: String, required: true }, // 0 = 栏目 1 = 单页 2 = 链接
- // 链接地址
- url: { type: String, required: false },
- // 绑定栏目
- column: { type: Array, required: false },
- // 绑定单页
- pages: { type: String, required: false },
- // 父级编码
- parentCode: { type: String, required: false },
- // 是否显示
- isshow: { type: Boolean, required: false },
- // 模板
- template: { type: String, required: false },
- };
- const schema = new Schema(SchemaDefine);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('menu', schema, 'menu');
- };
|