WeaponModsController - xEdziu/RPG-Handy-Helper GitHub Wiki
This page contains documentation for the CpRedweaponModsController
class, which handles weapon mods management for Cyberpunk Red.
Base Path: /api/v1/authorized
Package: dev.goral.rpghandyhelper.rpgSystems.cpRed.manual.weaponMods
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/weaponMods/all |
Returns basic info about all available weapon mods |
GET | /rpgSystems/cpRed/weaponMods/{weaponModId} |
Returns detailed information about a specific weapon mods by ID |
GET | /admin/rpgSystems/cpRed/weaponMods/all |
Returns a full list of all weapon mods types with administrative data |
POST | /admin/rpgSystems/cpRed/weaponMods/add |
Adds a new weapon mods type to the system |
PUT | /admin/rpgSystems/cpRed/weaponMods/update/{weaponModId} |
Update weapon mods data |
- name (String): Name of the weapon mod. Required.
- price (Integer): Price of the weapon mod. Required.
- size (Integer): Size of the weapon mod in slots. Required.
-
availability (String): Availability status. Required. Possible values:
CHEAP
,EVERYDAY
,COSTLY
,PREMIUM
,EXPENSIVE
,VERY_EXPENSIVE
,LUXURY
,SUPER_LUXURY
. - description (String): Description of the weapon mods. Required.
- message (String): Describes the result of the operation.
- error (Integer): HTTP status code.
- timestamp (String): Time the response was generated.
- weaponMod (Object): A single weaponm mod object (if applicable).
- weaponModList (Array): List of weapon mods (if applicable).
Method: GET
Path: /rpgSystems/cpRed/weaponMods/all
{
"weaponMods": [
{
"name": "Tłumik",
"price": 200,
"size": 2,
"availability": "CHEAP",
"description": "Tłumik do broni palnej."
},
{
"name": "Kolimator",
"price": 400,
"size": 1,
"availability": "PREMIUM",
"description": "Kolimator do broni palnej, który poprawia celność strzałów."
}
],
"message": "Pobrano modyfikacje broni",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in.
Method: GET
Path: /rpgSystems/cpRed/weaponMods/{weaponModId}
{
"weaponMod": {
"name": "Tłumik",
"price": 200,
"size": 2,
"availability": "CHEAP",
"description": "Tłumik do broni palnej."
},
"message": "Pobrano modyfikację broni",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid weapon mod ID. -
401 Unauthorized
: User is not logged in. -
404 Not Found
: Weapon mod with the specified ID does not exist.
Method: GET
Path: admin/rpgSystems/cpRed/weaponMods/all
{
"weaponMods": [
{
"id": 1,
"name": "Tłumik",
"price": 200,
"size": 2,
"availability": "CHEAP",
"description": "Tłumik do broni palnej."
},
{
"id": 2,
"name": "Kolimator",
"price": 400,
"size": 1,
"availability": "PREMIUM",
"description": "Kolimator do broni palnej, który poprawia celność strzałów."
}
],
"message": "Pobrano modyfikacje broni",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in. -
403 Forbidden
: User is not an admin.
Method: POST
Path: /admin/rpgSystems/cpRed/weaponMods/add
{
"name": "mod",
"price": 100,
"size": 20,
"availability": "CHEAP",
"description": "A cheap mod"
}
{
"message": "Dodano modyfikację broni",
"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 Weapon mod data.
Method: PUT
Path: /admin/rpgSystems/cpRed/weaponMods/update/{weaponModId}
{
"name": "mod 2.0",
"price": 300,
"size": 10,
"availability": "LUXURY",
"description": "Awesome mod"
}
{
"message": "Zaktualizowano modyfikację broni",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid weaponMods ID or data. -
401 Unauthorized
: User not logged in. -
403 Forbidden
: User is not an admin. -
404 Not Found
: Weapon mod 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.