CustomEquipmentsController - xEdziu/RPG-Handy-Helper GitHub Wiki
This page contains documentation for the CpRedCustomArmorsController
class, which handles custom equipments management for Cyberpunk Red.
Base Path: /api/v1/authorized
Package: dev.goral.rpghandyhelper.rpgSystems.cpRed.custom.customEquipments
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/customEquipments/all |
Returns basic info about all available custom equipments |
GET | /rpgSystems/cpRed/customEquipments/{equipmentId} |
Returns detailed information about a specific custom equipment by ID |
GET | /rpgSystems/cpRed/customEquipments/game/{gameId} |
Returns basic info about all available custom equipments by game ID |
GET | /admin/rpgSystems/cpRed/customEquipments/all |
Returns a full list of all custom equipments types with administrative data |
POST | /rpgSystems/cpRed/customEquipments/add |
Adds a new custom equipment type to the system |
PUT | /rpgSystems/cpRed/customEquipments/update/{equipmentId} |
Update custom equipment data |
- gameId (Long): ID of the game this custom Equipment belongs to. Required.
- name (String): Name of the equipment. Required.
- price (Integer): Price for equipment in eurodollars. Required.
-
availability (String): Availability status. Required. Possible values:
CHEAP
,EVERYDAY
,COSTLY
,PREMIUM
,EXPENSIVE
,VERY_EXPENSIVE
,LUXURY
,SUPER_LUXURY
. - -description (String): Description of the equipment. Required.
- message (String): Describes the result of the operation.
- error (Integer): HTTP status code.
- timestamp (String): Time the response was generated.
- customEquipment (Object): A single custom Equipment object (if applicable).
- customArmorList (Array): List of custom Equipments (if applicable).
Method: GET
Path: /rpgSystems/cpRed/customEquipments/all
{
"customEquipments": [
{
"gameId": 1,
"name": "Customowy zestaw narzędzi",
"price": 200,
"availability": "COSTLY",
"description": "Customowy zestaw narzędzi zawierający zaawansowane narzędzia do modyfikacji sprzętu."
},
{
"gameId": 1,
"name": "Customowa apteczka",
"price": 150,
"availability": "EXPENSIVE",
"description": "Customowa apteczka zawierająca zaawansowane materiały medyczne do leczenia ran i kontuzji."
}
],
"message": "Customowe wyposażenie zostały pobrane.",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in.
Method: GET
Path: /rpgSystems/cpRed/customEquipments/{ArmorId}
{
"customEquipments": {
"gameId": 1,
"name": "Customowy zestaw narzędzi",
"price": 200,
"availability": "COSTLY",
"description": "Customowy zestaw narzędzi zawierający zaawansowane narzędzia do modyfikacji sprzętu."
},
"message": "Customowe wyposażenie zostały pobrane.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid custom equipment ID. -
401 Unauthorized
: User is not logged in. -
404 Not Found
:Custom equipment with the specified ID does not exist.
Method: GET
Path: /rpgSystems/cpRed/customEquipments/game/{gameId}
{
"customEquipments": [
{
"gameId": 1,
"name": "Customowy zestaw narzędzi",
"price": 200,
"availability": "COSTLY",
"description": "Customowy zestaw narzędzi zawierający zaawansowane narzędzia do modyfikacji sprzętu."
},
{
"gameId": 1,
"name": "Customowa apteczka",
"price": 150,
"availability": "EXPENSIVE",
"description": "Customowa apteczka zawierająca zaawansowane materiały medyczne do leczenia ran i kontuzji."
}
],
"message": "Customowe wyposażenie do gry zostało 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/customEquipments/all
{
"customEquipments": [
{
"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 zestaw narzędzi",
"price": 200,
"availability": "COSTLY",
"description": "Customowy zestaw narzędzi zawierający zaawansowane narzędzia do modyfikacji sprzętu."
},
{
"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": "Customowa apteczka",
"price": 150,
"availability": "EXPENSIVE",
"description": "Customowa apteczka zawierająca zaawansowane materiały medyczne do leczenia ran i kontuzji."
}
],
"message": "Customowe wyposażenie zostało pobrane.",
"error": 200,
"timestamp": "..."
}
-
401 Unauthorized
: User is not logged in. -
403 Forbidden
: User is not an admin.
Method: POST
Path: /admin/rpgSystems/cpRed/customEquipments/add
{
"gameId": 1,
"name": "mały sprzęt",
"price": 100,
"availability": "CHEAP",
"description": "sprzęt"
}
{
"message": "Customowe wyposażenie zostało dodane.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: User not authenticated. -
401 Unauthorized
: User not logged in. -
404 Not Found
: Invalid custom equipment data.
Method: PUT
Path: /admin/rpgSystems/cpRed/customEquipments/update/{ArmorsId}
{
"gameId": 1,
"name": "duży sprzęt",
"price": 150,
"availability": "CHEAP",
"description": "większy"
}
{
"message": "Customowe wyposażenie zostało zmodyfikowane.",
"error": 200,
"timestamp": "..."
}
-
400 Bad Request
: Invalid custom equipment ID or data. -
401 Unauthorized
: User not logged in. -
404 Not Found
:Custom equipment 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.