Skip to content

Commit

Permalink
structured ws message (might not work) 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ruskaof committed Mar 24, 2024
1 parent 3245e8f commit cf044bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/dto/dto.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ func DeserializeWebSocketClientMessage(data []byte) (message WebSocketClientMess
err = json.Unmarshal(data, &message)
return
}

type OpenDirectChatResponse struct {
ChatId int64 `json:"chatId"`
}
2 changes: 1 addition & 1 deletion src/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (uc UserController) handlerFindDirectChat(w http.ResponseWriter, r *http.Re
return
}

utils.WriteJson(w, chatId)
utils.WriteJson(w, dto.OpenDirectChatResponse{ChatId: chatId})
}

func (uc UserController) handlerHelloWorld(w http.ResponseWriter, r *http.Request) { // todo remove
Expand Down

0 comments on commit cf044bb

Please sign in to comment.