tDigitalService.js 1.1 KB

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