personroomtalk.js 568 B

1234567891011121314151617
  1. 'use strict';
  2. // 弃用
  3. const Schema = require('mongoose').Schema;
  4. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  5. const Personroomtalk = {
  6. pr_id: { type: String, required: true, maxLength: 200 }, // 房间id
  7. type: { type: String, required: false, maxLength: 200 }, // 类型
  8. };
  9. const schema = new Schema(Personroomtalk, { toJSON: { virtuals: true } });
  10. schema.index({ id: 1 });
  11. schema.plugin(metaPlugin);
  12. module.exports = app => {
  13. const { mongoose } = app;
  14. return mongoose.model('Personroomtalk', schema, 'person_room_talk');
  15. };