MaJ WS
This commit is contained in:
parent
608e0f7680
commit
e73b2daaf0
3 changed files with 6 additions and 6 deletions
|
|
@ -18,7 +18,7 @@ open class MatchWebSocketConfig : WebSocketMessageBrokerConfigurer {
|
||||||
registry.enableSimpleBroker(CHANNEL_MATCH_NAME)
|
registry.enableSimpleBroker(CHANNEL_MATCH_NAME)
|
||||||
|
|
||||||
// Prefix for messages FROM client TO server
|
// Prefix for messages FROM client TO server
|
||||||
registry.setApplicationDestinationPrefixes("/ws/matches")
|
registry.setApplicationDestinationPrefixes("/ws")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun registerStompEndpoints(registry: StompEndpointRegistry) {
|
override fun registerStompEndpoints(registry: StompEndpointRegistry) {
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
date: document.getElementById("matchDate").value
|
date: document.getElementById("matchDate").value
|
||||||
};
|
};
|
||||||
|
|
||||||
stompClient.send("/ws/matches/add", {}, JSON.stringify(match));
|
stompClient.send("/ws/add", {}, JSON.stringify(match));
|
||||||
|
|
||||||
displayMessage(match)
|
displayMessage(match)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,15 +63,15 @@
|
||||||
function sendMatch() {
|
function sendMatch() {
|
||||||
const match = {
|
const match = {
|
||||||
id: 1,
|
id: 1,
|
||||||
player1Id: parseInt(document.getElementById("player1Id").value),
|
player1ID: parseInt(document.getElementById("player1Id").value),
|
||||||
player2Id: parseInt(document.getElementById("player2Id").value),
|
player2ID: parseInt(document.getElementById("player2Id").value),
|
||||||
refereeId: parseInt(document.getElementById("refereeId").value),
|
refereeID: parseInt(document.getElementById("refereeId").value),
|
||||||
score1: parseInt(document.getElementById("score1").value),
|
score1: parseInt(document.getElementById("score1").value),
|
||||||
score2: parseInt(document.getElementById("score2").value),
|
score2: parseInt(document.getElementById("score2").value),
|
||||||
date: document.getElementById("matchDate").value
|
date: document.getElementById("matchDate").value
|
||||||
};
|
};
|
||||||
|
|
||||||
stompClient.send("/ws/matches/addPoint", {}, JSON.stringify({
|
stompClient.send("/ws/plusPoint", {}, JSON.stringify({
|
||||||
match: match,
|
match: match,
|
||||||
playerId: match.player1Id
|
playerId: match.player1Id
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue