CustomWeaponModsController - xEdziu/RPG-Handy-Helper GitHub Wiki
This page contains documentation for the CpRedCustomWeaponModsController
class, which handles custom WeaponMods management for Cyberpunk Red.
Base Path: /api/v1/authorized
Package: dev.goral.rpghandyhelper.rpgSystems.cpRed.custom.customWeaponMods
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/customWeaponMods/all |
Returns basic info about all available custom weapon mods |
GET | /rpgSystems/cpRed/customWeaponMods/{weaponModId} |
Returns detailed information about a specific custom weapon mod by ID |
GET | /rpgSystems/cpRed/customWeaponMods/game/{gameId} |
Returns basic info about all available custom weapon mods by game ID |
GET | /admin/rpgSystems/cpRed/customWeaponMods/all |
Returns a full list of all custom weapon mods types with administrative data |
POST | /rpgSystems/cpRed/customWeaponMods/add |
Adds a new custom weapon mod type to the system |
PUT | /rpgSystems/cpRed/customWeaponMods/update/{weaponModId} |
Update custom weapon mod data |
- gameId (Long): ID of the game this custom weapon mod belongs to. Required.
- 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.
- customWeaponMod (Object): A single custom weapon mod object (if applicable).
- customWeaponModList (Array): List of custom weapon mods (if applicable).
Method: GET
Path: /rpgSystems/cpRed/customWeaponMods/all
{
"customWeaponMods": [
{
"gameId": 1,
"name": "Customowy celownik",
"price": 1000,
"size": 2,
"availability": "COSTLY",
"description": "Customowy celownik do broni palnej."
},
{
"gameId": 1,
"name": "Customowy tłumik",
"price": 2000,
"size": 3,
"availability": "LUXURY",
"description": "Customowy tłumik do broni palnej, który zapewnia doskonałą redukcję hałasu."
}
],
"message": "Customowe modyfikacje broni zostały pobrane.",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in.
Method: GET
Path: /rpgSystems/cpRed/customWeaponMods/{weaponModId}
{
"customWeaponMod": {
"gameId": 1,
"name": "Customowy celownik",
"price": 1000,
"size": 2,
"availability": "COSTLY",
"description": "Customowy celownik do broni palnej."
},
"message": "Customowa modyfikacja broni została pobrana.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid custom weapon mod ID. -
401 Unauthorized
: User is not logged in. -
404 Not Found
:Custom weapon mod with the specified ID does not exist.
Method: GET
Path: /rpgSystems/cpRed/customWeaponMods/game/{gameId}
{
"customMods": [
{
"gameId": 1,
"name": "Customowy celownik",
"price": 1000,
"size": 2,
"availability": "COSTLY",
"description": "Customowy celownik do broni palnej."
},
{
"gameId": 1,
"name": "Customowy tłumik",
"price": 2000,
"size": 3,
"availability": "LUXURY",
"description": "Customowy tłumik do broni palnej, który zapewnia doskonałą redukcję hałasu."
}
],
"message": "Customowe modyfikacje do broni, do gry zostały pobrane.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid game ID. -
401 Unauthorized
: User is not logged in. -
404 Not Found
: Game with the specified ID does not exist.
Method: GET
Path: admin/rpgSystems/cpRed/customWeaponMods/all
{
"customWeaponMods": [
{
"id": 1,
"gameId": {
"id": 1,
"name": "Night City Adventures",
"description": "A thrilling adventure in the heart of Night City.",
"owner": {
"id": 1,
"username": "zuber",
"firstName": "Mateusz",
"surname": "Zubrzycki",
"email": "[email protected]",
"token": null,
"password": "$2a$10$Xg1TSDI6Erl.RcfpAPPuLOrnnskoLJ7wWPrC5QJU1e2h.cNd05JRO",
"role": "ROLE_ADMIN",
"locked": false,
"enabled": true,
"createdAt": "2025-06-25T08:25:00.517+00:00",
"userPhotoPath": "/img/profilePics/defaultProfilePic.png",
"accountNonLocked": true,
"oauthProvider": null,
"credentialsNonExpired": true,
"accountNonExpired": true,
"oauthId": null,
"authorities": [
{
"authority": "ROLE_ADMIN"
}
]
},
"rpgSystem": {
"id": 1,
"name": "Cyberpunk 2077",
"description": "A futuristic role-playing game set in the dystopian Night City."
},
"status": "ACTIVE"
},
"name": "Customowy celownik",
"price": 1000,
"size": 2,
"availability": "COSTLY",
"description": "Customowy celownik do broni palnej."
},
{
"id": 2,
"gameId": {
"id": 1,
"name": "Night City Adventures",
"description": "A thrilling adventure in the heart of Night City.",
"owner": 1,
"rpgSystem": {
"id": 1,
"name": "Cyberpunk 2077",
"description": "A futuristic role-playing game set in the dystopian Night City."
},
"status": "ACTIVE"
},
"name": "Customowy tłumik",
"price": 2000,
"size": 3,
"availability": "LUXURY",
"description": "Customowy tłumik do broni palnej, który zapewnia doskonałą redukcję hałasu."
}
],
"message": "Customowe modyfikacje broni 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/customWeaponMods/add
{
"gameId": 1,
"name": "my mod",
"price": 100,
"size": 10,
"availability": "CHEAP",
"description": "good custom mod"
}
{
"message": "Customowa modyfikacja broni została dodana.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: User not authenticated. -
401 Unauthorized
: User not logged in. -
404 Not Found
: Invalid custom weapon mod data.
Method: PUT
Path: /admin/rpgSystems/cpRed/customWeaponMods/update/{ArmorsId}
{
"gameId": 1,
"name": "my new mod",
"price": 150,
"size": 5,
"availability": "LUXURY",
"description": "better custom mod"
}
{
"message": "Customowa modyfikacja broni została zaktualizowana.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid custom weapon mod ID or data. -
401 Unauthorized
: User not logged in. -
404 Not Found
:Custom 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.