CustomCyberwaresController - xEdziu/RPG-Handy-Helper GitHub Wiki

CpRedCustomCyberwaresController

This page contains documentation for the CpRedCustomCyberwaresController class, which handles custom cyberwares management for Cyberpunk Red.

Basic Information

Base Path: /api/v1/authorized
Package: dev.goral.rpghandyhelper.rpgSystems.cpRed.custom.customCyberwares

Authentication

All requests to this controller require an XSRF token to be included in the headers.
Example:

headers: {
  "X-XSRF-TOKEN": "<csrfToken>"
}

Endpoint Summary

HTTP Method Path Description
GET /rpgSystems/cpRed/customCyberwares/all Returns basic info about all available custom Cyberwares
GET /rpgSystems/cpRed/customCyberwares/{cyberwareId} Returns detailed information about a specific custom cyberware by ID
GET /rpgSystems/cpRed/customCyberwares/game/{gameId} Returns basic info about all available custom Cyberwares by game ID
GET /admin/rpgSystems/cpRed/customCyberwares/all Returns a full list of all custom Cyberwares types with administrative data
POST /rpgSystems/cpRed/customCyberwares/add Adds a new custom cyberware type to the system
PUT /rpgSystems/cpRed/customCyberwares/update/{cyberwareId} Update custom cyberware data

Field Descriptions

Request Body Fields (CustomCyberwaresDto)

  • gameId (Long): ID of the game this custom cyberware belongs to. Required.
  • name (String): Name of the cyberware. Required.
  • mountPlace (String): Body part where the cyberware is mounted. Required. Possible values: FASHIONWARE, NEURALWARE, CYBEROPTIC, CYBERAUDIO, INTERNAL_BODY_CYBERWARE, EXTERNAL_BODY_CYBERWARE, CYBERLIMB, BORGWARE.
  • requirements (String): Requirements for using the cyberware. Required.
  • humanityLoss (Integer): Humanity loss associated with the cyberware. Required.
  • size (Integer): Size of the cyberware. Required.
  • installationPlace (String): Place where the cyberware is installing. Required. Possible values: MALL, CLINIC, HOSPITAL.
  • price (Integer): Price for cyberware 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 cyberware. Required.

Response Fields

  • message (String): Describes the result of the operation.
  • error (Integer): HTTP status code.
  • timestamp (String): Time the response was generated.
  • customCyberware (Object): A single custom cyberware object (if applicable).
  • customCyberwaresList (Array): List of custom cyberwares (if applicable).

Endpoint Details

Get All Custom Cyberwares

Method: GET
Path: /rpgSystems/cpRed/customCyberwares/all

Response

{
  "customCyberwares": [
    {
      "gameId": 1,
      "name": "strzykawka",
      "mountPlace": "CYBERLIMB",
      "requirements": "cyberręka",
      "humanityLoss": "1k6",
      "size": 1,
      "installationPlace": "MALL",
      "price": 500,
      "availability": "CHEAP",
      "description": "Customowa cybernetyczna strzykawka do implantacji."
    },
    {
      "gameId": 1,
      "name": "modliszki",
      "mountPlace": "CYBERLIMB",
      "requirements": "dwie cyberręce i sparowanie",
      "humanityLoss": "3k6",
      "size": 3,
      "installationPlace": "HOSPITAL",
      "price": 5000,
      "availability": "EXPENSIVE",
      "description": "Customowa cybernetyczna strzykawka do implantacji."
    }
  ],
  "message": "Customowe wszczepy zostały pobrane.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 401 Unauthorized: User is not logged in.

Get Custom cyberware by ID

Method: GET
Path: /rpgSystems/cpRed/customCyberwares/{cyberwareId}

Response

{
  "customCyberware": {
    "gameId": 1,
    "name": "strzykawka",
    "mountPlace": "CYBERLIMB",
    "requirements": "cyberręka",
    "humanityLoss": "1k6",
    "size": 1,
    "installationPlace": "MALL",
    "price": 500,
    "availability": "CHEAP",
    "description": "Customowa cybernetyczna strzykawka do implantacji."
  },
  "message": "Customowy wszczep został pobrany.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid custom cyberware ID.
  • 401 Unauthorized: User is not logged in.
  • 404 Not Found:Custom cyberware with the specified ID does not exist.

Get Custom Cyberwares by Game ID

Method: GET
Path: /rpgSystems/cpRed/customCyberwares/game/{gameId}

Response

{
  "customCyberwares": [
    {
      "gameId": 1,
      "name": "strzykawka",
      "mountPlace": "CYBERLIMB",
      "requirements": "cyberręka",
      "humanityLoss": "1k6",
      "size": 1,
      "installationPlace": "MALL",
      "price": 500,
      "availability": "CHEAP",
      "description": "Customowa cybernetyczna strzykawka do implantacji."
    },
    {
      "gameId": 1,
      "name": "modliszki",
      "mountPlace": "CYBERLIMB",
      "requirements": "dwie cyberręce i sparowanie",
      "humanityLoss": "3k6",
      "size": 3,
      "installationPlace": "HOSPITAL",
      "price": 5000,
      "availability": "EXPENSIVE",
      "description": "Customowa cybernetyczna strzykawka do implantacji."
    }
  ],
  "message": "Customowe wszczepy do gry zostały pobrane.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid game ID.
  • 401 Unauthorized: User is not logged in.
  • 404 Not Found: Game with the specified ID does not exist.

Get All Custom Cyberwares with Admin Data

Method: GET
Path: admin/rpgSystems/cpRed/customCyberwares/all

Response

{
  "customCyberwares": [],
  "message": "Customowe wszczepy zostały pobrane dla administratora.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 401 Unauthorized: User is not logged in.
  • 403 Forbidden: User is not an admin.

Add New Custom cyberware

Method: POST
Path: /admin/rpgSystems/cpRed/customCyberwares/add

Request

{
  "gameId": 1,
  "name": "Wszczep własny 1.0",
  "mountPlace": "NEURALWARE",
  "requirements": "none",
  "humanityLoss": "2 (2K6)",
  "size": 5,
  "installationPlace": "CLINIC",
  "price": 100,
  "availability": "CHEAP",
  "description": "słaby wszczep"
}

Response

{
  "message": "Customowy wszczep został dodany.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: User not authenticated.
  • 401 Unauthorized: User not logged in.
  • 404 Not Found: Invalid custom cyberware data.

Update Custom Cyberwares

Method: PUT
Path: /admin/rpgSystems/cpRed/customCyberwares/update/{CyberwaresId}

Request

{
  "gameId": 1,
  "name": "Wszczep własny 2.0",
  "mountPlace": "NEURALWARE",
  "requirements": "none",
  "humanityLoss": "2 (2K6)",
  "size": 1,
  "installationPlace": "CLINIC",
  "price": 150,
  "availability": "CHEAP",
  "description": "inny wszczep"
}

Response

{
  "message": "Customowy wszczep został zmodyfikowany.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid custom cyberware ID or data.
  • 401 Unauthorized: User not logged in.
  • 404 Not Found:Custom cyberware with the specified ID does not exist.

Common Troubleshooting Tips

  • 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.
⚠️ **GitHub.com Fallback** ⚠️