|
@@ -1,19 +1,10 @@
|
|
|
'use strict';
|
|
|
const Schema = require('mongoose').Schema;
|
|
|
const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
-// 图片路径
|
|
|
-const images = new Schema({
|
|
|
- url: { type: String, required: true, maxLength: 500 }, // 图片路径
|
|
|
- name: { type: String, required: true, maxLength: 500 }, // 图片名称
|
|
|
-});
|
|
|
// 企业信息
|
|
|
const CompanySchema = {
|
|
|
company: { type: String, required: true, maxLength: 200 }, // 名称
|
|
|
mobile: { type: String, required: false, maxLength: 500 }, // 电话
|
|
|
- type: { type: String, required: false, maxLength: 500, default: 0 }, // 视频
|
|
|
- file: { type: String, required: false, maxLength: 500 }, // 单张图片
|
|
|
- video: { type: String, required: false, maxLength: 500 }, // 视频
|
|
|
- image: { type: [ images ], select: true }, // 图片
|
|
|
};
|
|
|
|
|
|
const schema = new Schema(CompanySchema, { toJSON: { virtuals: true } });
|