dockImgtxt.js 950 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin');
  5. const { ObjectId } = require('mongoose').Types;
  6. // 展会图片表
  7. const dock_imgtxt = {
  8. dock_id: { type: String }, // 展会id
  9. sender_id: { type: String }, // 发送人id
  10. sender_name: { type: String }, // 发送人姓名
  11. content: { type: String }, // 信息内容
  12. img_url: { type: Array }, // 图片
  13. video_url: { type: Array }, // 视频地址
  14. send_time: { type: String }, // 发送时间
  15. remark: { type: String },
  16. };
  17. const schema = new Schema(dock_imgtxt, { toJSON: { virtuals: true } });
  18. schema.index({ id: 1 });
  19. schema.index({ dock_id: 1 });
  20. schema.index({ sender_id: 1 });
  21. schema.index({ 'meta.createdAt': 1 });
  22. schema.plugin(metaPlugin);
  23. module.exports = app => {
  24. const { mongoose } = app;
  25. return mongoose.model('DockImgtxt', schema, 'dockImgtxt');
  26. };