WeaponModsCompatibilityController - xEdziu/RPG-Handy-Helper GitHub Wiki

CpRedModCompatibilityController

This page contains documentation for the CpRedModWeaponCompatibilityController class, which handles weapon mods compatibility management for Cyberpunk Red.

Basic Information

Base Path: /api/v1/authorized
Package: `dev.goral.rpghandyhelper.rpgSystems.cpRed.compatibility.weaponMod;

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 /compatibility/mod/all Returns basic info about all weapon mod compatibility
GET /compatibility/mod/{id} Returns detailed information about a specific weapon mod compatibility by ID
GET /compatibility/mod/forWeapon Returns a list of all weapon mod compatibility by weapon
GET /compatibility/mod/forMod Returns a list of all weapon mod compatibility by mod
POST /compatibility/mod/add Adds a new weapon mod compatibility type to the system
PUT /compatibility/mod/update/{id} Update weapon mod compatibility data

Field Descriptions

Request Body Fields (ModCompatibilityDto)

  • Id (Long): Unique identifier for the weapon compatibility. Required.
  • weaponId (Long): ID of the weapon this weapon is compatible with. Required.
  • modId (Long): ID of the mod this compatibility applies to. Required.
  • isWeaponCustom (Boolean): Indicates if the weapon is custom. Required.
  • isModCustom (Boolean): Indicates if the mod is custom. Required.

Response Fields

  • message (String): Describes the result of the operation.
  • error (Integer): HTTP status code.
  • timestamp (String): Time the response was generated.
  • weaponCompatibility (Object): A single weapon mod compatibility object (if applicable).
  • weaponCompatibilityList (Array): List of weapons mod compatibility (if applicable).

Endpoint Details

Get All Weapon Mods Compatibility

Method: GET
Path: /compatibility/mod/all

Response

{
  "weaponModCompatibility": [],
  "message": "Lista kompatybilności modyfikacji została pobrana",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 401 Unauthorized: User is not logged in.

Get Weapon Mod Compatibility by ID

Method: GET
Path: /compatibility/mod/{id}

Response

{
  "weaponModCompatibility": {
    "id": 1,
    "weaponId": 1,
    "modId": 1,
    "weaponCustom": true,
    "modCustom": true
  },
  "message": "Kompatybilność modyfikacji została pobrana",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid weapon compatibility ID.
  • 401 Unauthorized: User is not logged in.
  • 404 Not Found: Weapon mod compatibility with the specified ID does not exist.

Get Weapon Mod Compatibility by Weapon

Method: GET
Path: /compatibility/mod/forWeapon

Request

{
  "weaponId": 1,
  "weaponCustom": true
}

Response

{
  "weaponModCompatibility": [
    {
      "id": 1,
      "weaponId": 1,
      "modId": 1,
      "weaponCustom": true,
      "modCustom": true
    }
  ],
  "message": "Kompatybilność modyfikacji dla broni została pobrana",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

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

Get Weapon Mod Compatibility by Mod

Method: GET
Path: /compatibility/mod/forMod

Request

{
  "modId": 1,
  "modCustom": true
}

Response

{
  "weaponModCompatibility": [
    {
      "id": 1,
      "weaponId": 1,
      "modId": 1,
      "weaponCustom": true,
      "modCustom": true
    }
  ],
  "message": "Kompatybilność modyfikacji dla broni została pobrana",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

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

Add New Weapon Mod Compatibility

Method: POST
Path: /compatibility/mod/add

Request

{
  "modId": 1,
  "weaponId": 1,
  "weaponCustom": true,
  "modCustom": true
}

Response

{
  "message": "Kompatybilność modyfikacji została dodana.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: User not authenticated.
  • 401 Unauthorized: User not logged in.
  • 404 Not Found: Invalid weapon mod compatibility data.

Update Weapon Compatibility

Method: PUT
Path: /compatibility/mod/update/{id}

Request

{
  "modId": 1,
  "weaponId": 1,
  "weaponCustom": false,
  "modCustom": false
}

Response

{
  "message": "Kompatybilność modyfikacji została zmieniona.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid weapon compatibility ID or data.
  • 401 Unauthorized: User not logged in.
  • 404 Not Found: Weapon mod compatibility 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** ⚠️