Game calendar working

This commit is contained in:
2025-03-06 19:49:23 -05:00
parent 70d3b22cdc
commit 78453ebfa1
21 changed files with 381 additions and 1 deletions

View File

@@ -148,4 +148,44 @@ public class RaidGroupController{
return returnNode;
}
@GetMapping("/game/{gameId}")
@AccountAuthorization(permissions = {AccountPermissionType.ADMIN, AccountPermissionType.USER})
public List<RaidGroup> getRaidGroupsByGame(@PathVariable("gameId") UUID gameId, @RequestParam("page") int page, @RequestParam("pageSize") int pageSize, @RequestParam(value = "searchTerm", required = false) String searchTermString){
log.info("Getting raid groups for game {} page {} of size {} with search term {}", gameId, page, pageSize, searchTermString);
List<RaidGroup> raidGroups;
if((searchTermString == null) || (searchTermString.isBlank())){
raidGroups = raidGroupService.getRaidGroupsByGame(gameId, page, pageSize);
}
else{
raidGroups = raidGroupService.getRaidGroupsByGame(gameId, page, pageSize, searchTermString);
}
return raidGroups;
}
@GetMapping("/game/{gameId}/count")
@AccountAuthorization(permissions = {AccountPermissionType.ADMIN, AccountPermissionType.USER})
public ObjectNode getRaidGroupsCountByGame(@PathVariable("gameId") UUID gameId, @RequestParam(value = "searchTerm", required = false) String searchTerm){
log.info("Getting raid groups count for game {} with search term {}", gameId, searchTerm);
Long raidGroupsCount;
if((searchTerm == null) || (searchTerm.isBlank())){
raidGroupsCount = raidGroupService.getRaidGroupsCountByGame(gameId);
}
else{
raidGroupsCount = raidGroupService.getRaidGroupsCountByGame(gameId, searchTerm);
}
ObjectNode countNode = mapper.createObjectNode();
countNode.put("count", raidGroupsCount);
countNode.put("status", "success");
return countNode;
}
}