'use strict'; const Schema = require('mongoose').Schema; const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); const { Secret } = require('naf-framework-mongoose/lib/model/schema'); // 数字延伸服务 const TDigitalServiceSchema = { type: { type: String, required: true }, // 类型,0-财务服务,1-数字化服务,2-法律服务,3-技术服务,4-市场服务 type_description: { type: String, required: false }, // 类型描述 title: { type: String, required: true }, // 标题 service: { type: String, required: true }, // 提供的服务 image: { type: String, required: true }, // 图片 description: { type: String, required: true }, // 机构介绍 contact: { type: String, required: true }, // 联系人 phone: { type: String, required: true }, // 联系电话 email: { type: String, required: false }, // 电子邮箱 }; const schema = new Schema(TDigitalServiceSchema, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('TDigitalService', schema, 't_digital_service'); };