private room but socketio not ready
This commit is contained in:
parent
c652958324
commit
36e6596c78
11 changed files with 5019 additions and 0 deletions
12
backend/service-privateroom/models/Conversation.js
Normal file
12
backend/service-privateroom/models/Conversation.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const mongoose = require("mongoose")
|
||||
|
||||
const ConversationSchema = new mongoose.Schema(
|
||||
{
|
||||
members: {
|
||||
type: Array
|
||||
},
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("Conversation", ConversationSchema);
|
||||
21
backend/service-privateroom/models/Message.js
Normal file
21
backend/service-privateroom/models/Message.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const mongoose = require("mongoose")
|
||||
|
||||
const MessageSchema = new mongoose.Schema(
|
||||
{
|
||||
conversationId: {
|
||||
type: String
|
||||
},
|
||||
sender: {
|
||||
type: String
|
||||
},
|
||||
text: {
|
||||
type: String
|
||||
},
|
||||
date:{
|
||||
type: Date,
|
||||
},
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
module.exports = mongoose.model("PrivatedMessage", MessageSchema);
|
||||
Reference in a new issue