classDiagram
ChatService <|-- ChatServiceDomain: Inheritance
ChatController <.. ChatService: Dependency
ChatController <|-- ChatControllerDomain: Inheritance
class ChatController{
+ChatService _chatService
constructor(_chatService: ChatService)
+createUser(data: IChat.CreateUser, _metadata: Metadata, call: ServerUnaryCall<IChat.CreateUser, IChat.ResponseCreateUser>, ):IChat.ResponseCreateUser
+getAllUsers():IChat.ResponseGetAll
+sendMessageToUser(data: Observable<IChat.SendToUser>)
}
class ChatService{
+IChat.User[] users
+IChat.AttempsMsg[] attempsMsg
+createUser(payload: IChat.CreateUser, call: ServerUnaryCall<IChat.CreateUser, IChat.ResponseCreateUser>, )
+getAllUsers():IChat.ResponseGetAll
+joinChat(payload: Observable<IChat.SendToUser>):Observable<IChat.ReceiveMsg>
}
- Endpoints
- CreateUser
- Interface: IChat.CreateUser
- Stream: No
- Body:
{ "user": "gb" }
- Response:
{ "error": "", "userCreated": true }
- GetAllUsers
- Interface: N/A
- Stream: No
- Body: No
- Response:
{ "users": [ { "id": 1, "user": "gb" }, { "id": 2, "user": "gbOutroUsuario" } ] }
- SendMessageToUser
- Interface: IChat.SendToUser
- Stream: yes
- Bidirecional: yes
- Body:
{ "from": "gb", "toID": 2, "msg": "Olá amigo!" }
- CreateUser