StatsController - xEdziu/RPG-Handy-Helper GitHub Wiki
This page contains documentation for the CpRedStatsController
, which manages stats in the Cyberpunk Red RPG system.
Base Path: /api/v1/authorized
Package: dev.goral.rpghandyhelper.rpgSystems.cpRed.manual.stats
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/cpRed/stats/all |
Returns basic info about all available stats |
GET | /rpgSystems/cpRed/stats/{statId} |
Returns detailed information about a specific stat by ID |
GET | /admin/rpgSystems/cpRed/stats/all |
Returns a full list of all stats types with administrative data |
POST | /admin/rpgSystems/cpRed/stats/add |
Adds a new stat type to the system |
PUT | /admin/rpgSystems/cpRed/stats/changeable/{statId} |
Change indicator |
PUT | /admin/rpgSystems/cpRed/stats/update/{statId} |
Update stat data |
- name (String): Name of the stat. Required.
- tag (String): Unique tag for the stat. Required.
- changeable (Boolean): Indicates if the stat can be changed. Required.
- description (String): Description of the stat. Required.
- message (String): Describes the result of the operation.
- error (Integer): HTTP status code.
- timestamp (String): Time the response was generated.
- stat (Object): A single stat object (if applicable).
- statList (Array): List of stats (if applicable).
Method: GET
Path: /rpgSystems/cpRed/stats/all
{
"stats": [
{
"name": "Zwinność",
"tag": "ZW",
"description": "Zwinność określa zdolność postaci do wykonywania zwinnych ruchów, unikania ataków i wykonywania skomplikowanych manewrów."
}
],
"message": "Statystyki zostały pobrane.",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in.
Method: GET
Path: /rpgSystems/cpRed/skils/{statId}
{
"stat": {
"name": "Zwinność",
"tag": "ZW",
"description": "Zwinność określa zdolność postaci do wykonywania zwinnych ruchów, unikania ataków i wykonywania skomplikowanych manewrów."
},
"message": "Statystyka została pobrana.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid stat ID. -
401 Unauthorized
: User is not logged in. -
404 Not Found
: stat with the specified ID does not exist.
Method: GET
Path: admin/rpgSystems/cpRed/stats/all
{
"stats": [
{
"id": 1,
"name": "Zwinność",
"tag": "ZW",
"changeable": false,
"description": "Zwinność określa zdolność postaci do wykonywania zwinnych ruchów, unikania ataków i wykonywania skomplikowanych manewrów."
}
],
"message": "Statystyki zostały pobrane dla administratora.",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in. -
403 Forbidden
: User is not an admin.
Method: POST
Path: /admin/rpgSystems/cpRed/stat/add
{
"name": "Inteligencja",
"tag": "INT",
"changeable": true,
"description": "Określa ogólną sprawność rozumowania. Według zasad to nie tylko czysta inteligencja, lecz także spryt, wiedza, spostrzegawczość i zdolność uczenia się"
}
{
"message": "Statystyka została dodana.",
"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 stat data.
Method: PUT
Path: /admin/rpgSystems/cpRed/stats/changeable/{statId}
{
"message": "Zmienność statystyki została zmieniona.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid stat ID. -
401 Unauthorized
: User not logged in. -
403 Forbidden
: User is not an admin. -
404 Not Found
: stat with the specified ID does not exist.
Method: PUT
Path: /admin/rpgSystems/cpRed/cyberwares/stat/{statId}
{
"tag": "INT",
"description": "Inny opis"
}
{
"message": "Statystyka została zaktualizowana.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid stat ID or data. -
401 Unauthorized
: User not logged in. -
403 Forbidden
: User is not an admin. -
404 Not Found
: stat 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.