CriticalInjuriesController - xEdziu/RPG-Handy-Helper GitHub Wiki
This page contains documentation for the CpRedCriticalInjuriesController
class, which handles operations related to critical injuries in the Cyberpunk Red.
Base Path: /api/v1/authorized
Package: dev.goral.rpghandyhelper.rpgSystems.cpRed.manual.criticalInjuries
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 | /rpgSystems/cpRed/criticalInjuries/all |
Returns basic info about all available critical injuries |
GET | /rpgSystems/cpRed/criticalInjuries/{injuryId} |
Returns detailed information about a specific critical injury by ID |
GET | /admin/rpgSystems/cpRed/criticalInjuries/all |
Returns a full list of all critical injuries with administrative data |
POST | /admin/rpgSystems/cpRed/criticalInjuries/add |
Adds a new critical injury type to the system |
PUT | /admin/rpgSystems/cpRed/criticalInjuries/update/{injuryId} |
Update critical injury data |
- rollValue (Integer): The roll value for the critical injury. Required.
-
injuryPlace (String): The place of the injury on the body. Required. Possible values:
HEAD
,BODY
. - name (String): Name of the critical injury. Required.
- effect (String): Description of the critical injury effect. Required.
- patching (String): Description of the patching process for the injury. Required.
- treating (String): Description of the treatment process for the injury. Required.
- message (String): Describes the result of the operation.
- error (Integer): HTTP status code.
- timestamp (String): Time the response was generated.
- criticalInjury (Object): A single critical injury object (if applicable).
- criticalInjuryList (Array): List of critical injuries (if applicable).
Method: GET
Path: /rpgSystems/cpRed/criticalInjuries/all
{
"criticalInjuries": [
{
"rollValue": 3,
"injuryPlace": "HEAD",
"name": "Critical Hit",
"effects": "Critical damage",
"patching": "None",
"treating": "None"
}
],
"message": "Pobrano wszystkie rodzaje ran krytycznych.",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in.
Method: GET
Path: /rpgSystems/cpRed/criticalInjuries/{injuryId}
{
"criticalInjury": {
"rollValue": 3,
"injuryPlace": "HEAD",
"name": "Critical Hit",
"effects": "Critical damage",
"patching": "None",
"treating": "None"
},
"message": "Pobrano rany krytyczne o id 1",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid critical injury ID. -
401 Unauthorized
: User is not logged in. -
404 Not Found
: Critical injury with the specified ID does not exist.
Method: GET
Path: admin/rpgSystems/cpRed/criticalInjuries/all
{
"criticalInjuries": [
{
"id": 1,
"rollValue": 3,
"injuryPlace": "HEAD",
"name": "Critical Hit",
"effects": "Critical damage",
"patching": "None",
"treating": "None"
}
],
"message": "Pobrano wszystkie rany krytyczne.",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in. -
403 Forbidden
: User is not an admin.
Method: POST
Path: /admin/rpgSystems/cpRed/criticalInjuries/all
{
"rollValue": 3,
"injuryPlace": "HEAD",
"name": "Critical Hit",
"effects": "Critical damage",
"patching": "None",
"treating": "None"
}
{
"message": "Rany krytyczne zostały dodane.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: User not authenticated. -
401 Unauthorized
: User not logged in. -
403 Forbidden
: User is not an admin. -
404 Not Found
: Invalid critical injury data.
Method: PUT
Path: /admin/rpgSystems/cpRed/criticalInjuries/update/{injuryId}
{
"rollValue": 2,
"injuryPlace": "HEAD",
"name": "Critical Hit 2.0",
"effects": "Critical damage",
"patching": "yes",
"treating": "None"
}
{
"message": "Rany krytyczne zostały zaktualizowane.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid armor ID or data. -
401 Unauthorized
: User not logged in. -
403 Forbidden
: User is not an admin. -
404 Not Found
: Critical Injury with the specified ID does not exist.
-
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.