CharacterAmmunitionController - xEdziu/RPG-Handy-Helper GitHub Wiki
This page contains documentation for the CpRedCharacterAmmunitionController
class, which handles character ammunition management for Cyberpunk Red.
Base Path: /api/v1/authorized
Package: dev.goral.rpgSystems.cpRed.characters.characterAmmunition
All requests to this controller require an XSRF token to be included in the headers.
Example:
headers: {
"X-XSRF-TOKEN": "<csrfToken>"
}
HTTP Method | Path | Description |
---|---|---|
GET | /games/cpRed/characters/ammunition/{characterId} |
Returns detailed information about a specific character ammunition by characterID |
POST | /games/cpRed/characters/ammunition/create |
Adds a new connection between ammunition type and character to the system |
PUT | /games/cpRed/characters/ammunition/update/{characterAmmunitionId} |
Update character ammunition data |
DELETE | /games/cpRed/characters/ammunition/delete/{characterAmmunitionId} |
Delete character ammunition data |
GET | /admin/games/cpRed/characters/ammunition/all |
Returns a full list of character ammunition type with administrative data |
- Id (Long): Unique identifier for the character ammunition. Required.
- CharacterId (Long): Unique identifier for the character. Required.
- AmmunitionId (Long): Unique identifier for the ammunition type. Required.
-
status (String): Status of the ammunition. Required. Possible values:
EQUIPPED
,STORED
. - amount (Integer): Amount of ammunition available for the character. Required.
- message (String): Describes the result of the operation.
- error (Integer): HTTP status code.
- timestamp (String): Time the response was generated.
- characterAmmunition (Object): A single character ammunition object (if applicable).
- characterAmmunitionList (Array): List of character ammunition (if applicable).
Method: GET
Path: /games/cpRed/characters/ammunition/{characterId}
{
"message": "Amunicje postaci pobrane pomyślnie",
"error": 200,
"timestamp": "...",
"characterAmmunition": [
{
"id": 1,
"characterId": 2,
"ammunitionId": 2,
"status": "EQUIPPED",
"amount": 100
}
]
}
-
400 Bad Request
: Invalid Character ID. -
401 Unauthorized
: User is not logged in. -
404 Not Found
: Character with the specified ID does not exist.
Method: POST
Path: /games/cpRed/characters/ammunition/create
{
"characterId": "2",
"ammunitionId": "2",
"status": "EQUIPPED",
"amount": 100
}
{
"message": "Amunicja została dodana do postaci",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: User not authenticated. -
401 Unauthorized
: User not logged in. -
404 Not Found
: Invalid character ammunition data.
Method: PUT
Path: /games/cpRed/characters/ammunition/update/{characterAmmunitionId}
{
"characterId": "2",
"ammunitionId": "2",
"status": "STORED",
"amount": 50
}
{
"message": "Amunicja postaci została pomyślnie zmodyfikowana",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid character ammunition ID or data. -
401 Unauthorized
: User not logged in. -
404 Not Found
: Character ammunition with the specified ID does not exist.
Method: DELETE
Path: /games/cpRed/characters/ammunition/delete/{characterAmmunitionId}
{
"message": "Amunicja postaci została pomyślnie usunięta",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid character ammunition ID. -
401 Unauthorized
: User not logged in. -
404 Not Found
: Character ammunition with the specified ID does not exist.
Method: GET
Path: /admin/games/cpRed/characters/ammunition/all
{
"allCharacterAmmunition": [],
"message": "Wszystkie amunicje postaci pobrane pomyślnie",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in. -
403 Forbidden
: User is not an admin.
-
Missing XSRF Token: Ensure the
X-XSRF-TOKEN
header is included in every request. - Invalid Fields: Double-check the request body for missing or invalid fields.
- Permission Issues: Verify that the user has the necessary permissions for the requested operation.