personroom.js 721 B

12345678910111213141516171819
  1. 'use strict';
  2. // 弃用
  3. const Schema = require('mongoose').Schema;
  4. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  5. const Personroom = {
  6. buyer_id: { type: String, required: true, maxLength: 200 }, // 买家id
  7. seller_id: { type: String, required: true, maxLength: 200 }, // 卖家id
  8. buyer_name: { type: String, required: true, maxLength: 200 }, // 买家名称
  9. seller_name: { type: String, required: true, maxLength: 200 }, // 卖家名称
  10. };
  11. const schema = new Schema(Personroom, { toJSON: { virtuals: true } });
  12. schema.index({ id: 1 });
  13. schema.plugin(metaPlugin);
  14. module.exports = app => {
  15. const { mongoose } = app;
  16. return mongoose.model('Personroom', schema, 'person_room');
  17. };