imgtxtdock.js 881 B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. const images = new Schema({
  5. url: { type: String, required: true, maxLength: 500 }, // 图片路径
  6. });
  7. // 展会信息表
  8. const ImgtxtdockSchema = {
  9. dock_id: { type: String, required: true, maxLength: 500 }, // 展会id
  10. user_name: { type: String, required: false, maxLength: 500 }, // 姓名
  11. brief: { type: String, required: false, maxLength: 500 }, // 信息内容
  12. image: { type: [ images ], select: false }, // 图片
  13. file_path: { type: String, required: false }, // 视频路径
  14. };
  15. const schema = new Schema(ImgtxtdockSchema, { toJSON: { virtuals: true } });
  16. schema.index({ id: 1 });
  17. schema.plugin(metaPlugin);
  18. module.exports = app => {
  19. const { mongoose } = app;
  20. return mongoose.model('Imgtxtdock', schema, 'imgtxtdock');
  21. };