123456789101112131415161718192021 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 轮播图
- const CaseapplySchema = {
- name: { type: String, required: true, maxLength: 200 }, // 名称
- filepath: { type: String, required: false, maxLength: 200 }, // 图片路径
- create_time: { type: String, required: false, maxLength: 200 }, // 发布时间
- content: { type: String, required: false, maxLength: 500 }, // 内容
- brief: { type: String, required: false, maxLength: 500 }, // 简介
- };
- const schema = new Schema(CaseapplySchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Caseapply', schema, 'caseapply');
- };
|