-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
231ac48
commit bb2646e
Showing
6 changed files
with
114 additions
and
5 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/main/java/de/unistuttgart/towercrushbackend/clients/OverworldClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package de.unistuttgart.towercrushbackend.clients; | ||
|
||
import de.unistuttgart.towercrushbackend.data.KeybindingDTO; | ||
import org.springframework.cloud.openfeign.FeignClient; | ||
import org.springframework.web.bind.annotation.CookieValue; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
|
||
/** | ||
* This client sends a Request to the Overworld-Backend at the beginning of the game to retrieve | ||
* keybinding statistics for a player. | ||
*/ | ||
@FeignClient(name = "overworldClient", url = "${overworld.url}/players") | ||
public interface OverworldClient { | ||
/** | ||
* Retrieves the keybinding statistics for a specific player. | ||
* | ||
* @param playerId the player id, whose keybinding statistics are to be retrieved | ||
* @param binding the specific keybinding to retrieve statistics | ||
* @param accessToken the users access token | ||
*/ | ||
@GetMapping("/{playerId}/keybindings/{binding}") | ||
KeybindingDTO getKeybindingStatistic( | ||
@PathVariable("playerId") final String playerId, | ||
@PathVariable("binding") final String binding, | ||
@CookieValue("access_token") final String accessToken | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/de/unistuttgart/towercrushbackend/data/KeybindingDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package de.unistuttgart.towercrushbackend.data; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.FieldDefaults; | ||
|
||
/** | ||
* The KeybindingDTO.class contains all data that is retrieved from the overworld-backend | ||
*/ | ||
@Data | ||
@FieldDefaults(level = AccessLevel.PRIVATE) | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class KeybindingDTO { | ||
private String binding; | ||
private String key; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters