Skip to content

SkillsController

Mateusz Andrzejewski edited this page Jun 23, 2025 · 4 revisions

CpRedSkillsController

This page contains documentation for the CpRedSkillsController, which manages skills in the Cyberpunk Red RPG system.

Basic Information

Base Path: /api/v1/authorized
Package: dev.goral.rpghandyhelper.rpgSystems.cpRed.manual.skills

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/cpRed/skills/all Returns basic info about all available skills
GET /rpgSystems/cpRed/skills/{skillId} Returns detailed information about a specific skill by ID
GET /admin/rpgSystems/cpRed/skills/all Returns a full list of all skills types with administrative data
POST /admin/rpgSystems/cpRed/skills/add Adds a new skill type to the system
PUT /admin/rpgSystems/cpRed/skills/update/{skilltId} Update skill data

Field Descriptions

Request Body Fields (skillDto)

  • category (String): Category of the skill. Required. Possible values: AWARNESS,BODY,CONTROL,EDUCATION,FIGHTING,PERFORMANCE,RANGED_WEAPON,SOCIAL,TECHNIQUE.
  • name (String): Name of the skill. Required.
  • connectedStatTag (String): Tag of the stat connected to the skill. Required.
  • description (String): Description of the skill. Required.

Response Fields

  • message (String): Describes the result of the operation.
  • error (Integer): HTTP status code.
  • timestamp (String): Time the response was generated.
  • skill (Object): A single skill object (if applicable).
  • skillList (Array): List of skills (if applicable).

Endpoint Details

Get All skills

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

Response

{
 "skills": [
{
"category": "FIGHTING",
"name": "Bijatyka",
"connectedStatTag": "ZW",
"description": "Bijatyka to umiejętność walki wręcz"
}
],
"message": "Umiejętności zostały pobrane.",
"error": 200, 
"timestamp": "..."
}

Possible Errors

  • 401 Unauthorized: User is not logged in.

Get skill by ID

Method: GET
Path: /rpgSystems/cpRed/skils/{skillId}

Response

{
  "skill": {
    "category": "FIGHTING",
    "name": "Bijatyka",
    "connectedStatTag": "ZW",
    "description": "Bijatyka to umiejętność walki wręcz"
  },
  "message": "Umiejętność została pobrana.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

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

Get All skills with Admin Data

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

Response

{
  "skills": [
    {
      "id": 1,
      "category": "FIGHTING",
      "name": "Bijatyka",
      "connectedStat": {
        "id": 1,
        "name": "Zwinność",
        "tag": "ZW",
        "changeable": false,
        "description": "Zwinność określa zdolność postaci do wykonywania zwinnych ruchów, unikania ataków i wykonywania skomplikowanych manewrów."
      },
      "description": "Bijatyka to umiejętność walki wręcz"
    }
  ],
  "message": "Umiejętności 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 skill

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

Request

{
  "name": "Broń długa",
  "description": "Broń długa to rodzaj broni, która jest przeznaczona do strzelania z większej odległości. W przeciwieństwie do broni krótkiej, broń długa ma dłuższy lufę i zazwyczaj jest używana przez snajperów lub myśliwych. Broń długa może być używana zarówno do celów sportowych, jak i myśliwskich.",
  "connectedStatId": 1,
  "category": "RANGED_WEAPON"

}

Response

{
  "message": "Umiejętność została dodana.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: User not authenticated.
  • 401 Unauthorized: User not logged in.
  • 403 Forbidden: User is not an admin.
  • 404 Not Found: Invalid skill data.

Update skill

Method: PUT
Path: /admin/rpgSystems/cpRed/cyberwares/skill/{skillId}

Request

{
  "name": "Broń długa zmodyfikowana 2",
  "description": "Inny opis",
  "connectedStatId": 1,
  "category": "BODY"
}

Response

{
  "message": "Umiejętność została zmodyfikowana.",
  "error": 200,
  "timestamp": "..."
}

Possible Errors

  • 400 Bad Request: Invalid skill ID or data.
  • 401 Unauthorized: User not logged in.
  • 403 Forbidden: User is not an admin.
  • 404 Not Found: skill 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.

Clone this wiki locally