dock_pw.js 875 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const moment = require('moment');
  4. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  5. const { Secret } = require('naf-framework-mongoose/lib/model/schema');
  6. const { ObjectId } = require('mongoose').Types;
  7. // 展会-图文表
  8. const dockpw = {
  9. dock_id: { type: ObjectId }, // 展会id
  10. content: { type: String, maxLength: 500 }, // 信息内容
  11. url: { type: Array }, // 图片路径
  12. file_path: { type: String }, // 视频路径
  13. remark: { type: String, maxLength: 200 },
  14. create_time: { type: String, default: moment().format('YYYY-MM-DD HH:mm:ss') },
  15. };
  16. const schema = new Schema(dockpw, { toJSON: { virtuals: true } });
  17. schema.index({ id: 1 });
  18. schema.plugin(metaPlugin);
  19. module.exports = app => {
  20. const { mongoose } = app;
  21. return mongoose.model('Dock_pw', schema, 'dock_pw');
  22. };