cleanup username to uuid endpoint
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m32s

This commit is contained in:
Lee
2024-04-11 00:49:16 +01:00
parent f2e8360567
commit a11a90f530
6 changed files with 25 additions and 20 deletions

View File

@ -1,6 +1,7 @@
package cc.fascinated.controller;
import cc.fascinated.model.cache.CachedPlayer;
import cc.fascinated.model.cache.CachedPlayerName;
import cc.fascinated.model.player.Skin;
import cc.fascinated.service.PlayerService;
import io.swagger.v3.oas.annotations.Parameter;
@ -41,10 +42,10 @@ public class PlayerController {
@GetMapping(value = "/uuid/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getPlayerUuid(
@Parameter(description = "The UUID or Username of the player", example = "ImFascinated") @PathVariable String id) {
CachedPlayer player = playerService.getPlayer(id);
CachedPlayerName player = playerService.usernameToUuid(id);
return ResponseEntity.ok(Map.of(
"username", player.getUsername(),
"uuid", player.getUuid().toString()
"uuid", player.getUniqueId()
));
}