|
@@ -5,9 +5,9 @@ const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
const Personchat = {
|
|
const Personchat = {
|
|
sender_id: { type: String, required: true, maxLength: 200 }, // 发送人id
|
|
sender_id: { type: String, required: true, maxLength: 200 }, // 发送人id
|
|
receiver_id: { type: String, required: true, maxLength: 200 }, // 接收人id
|
|
receiver_id: { type: String, required: true, maxLength: 200 }, // 接收人id
|
|
- personroom_id: { type: String, required: true, maxLength: 200 }, //聊天房间id
|
|
|
|
|
|
+ personroom_id: { type: String, required: true, maxLength: 200 }, // 聊天房间id
|
|
content: { type: String, required: true, maxLength: 1000 }, // 发言内容
|
|
content: { type: String, required: true, maxLength: 1000 }, // 发言内容
|
|
- status: { type: String, required: false, maxLength: 100, default: "0" }, // 状态,0-未读,1-已读
|
|
|
|
|
|
+ status: { type: String, required: false, maxLength: 100, default: '0' }, // 状态,0-未读,1-已读
|
|
};
|
|
};
|
|
const schema = new Schema(Personchat, { toJSON: { virtuals: true } });
|
|
const schema = new Schema(Personchat, { toJSON: { virtuals: true } });
|
|
schema.index({ id: 1 });
|
|
schema.index({ id: 1 });
|
|
@@ -15,5 +15,5 @@ schema.plugin(metaPlugin);
|
|
|
|
|
|
module.exports = app => {
|
|
module.exports = app => {
|
|
const { mongoose } = app;
|
|
const { mongoose } = app;
|
|
- return mongoose.model("Personchat", schema, "person_chat");
|
|
|
|
|
|
+ return mongoose.model('Personchat', schema, 'person_chat');
|
|
};
|
|
};
|