This commit is contained in:
2024-12-16 16:51:46 +02:00
parent e264956831
commit 96fbfb60e8
16 changed files with 250 additions and 295 deletions
@@ -1,7 +1,7 @@
import express from 'express';
/**
* ScenariosController. API for the scenarios manager
* ScenariosController. API for the scenarios manager, граничен клас за комуникация с модула за игрови сценарии
*/
class ScenariosController{
@@ -9,15 +9,15 @@ class ScenariosController{
route = '/api/scenario'
/**
* Initializes the ScenariosController plugin
* @param {App} app The application instance
* Initializes the ScenariosController plugin, инициализация
* @param {App} app The application instance, апликация
*/
init(app){
const router = express.Router();
const { scenarios } = app;
/**
* API: PUT /api/scenario/ Create or update scenario
* API: PUT /api/scenario/ Create or update scenario, създаване/обновяване на игрови сценарий
* @function createOrUpdate
* @memberof ScenariosController
*/
@@ -26,7 +26,7 @@ class ScenariosController{
});
/**
* API: POST /api/scenario/ List scenarios by given criteria
* API: POST /api/scenario/ List scenarios by given criteria, търсене в игровите сценарии
* @function list
* @returns {Scenario[]}
* @memberof ScenariosController
@@ -35,9 +35,9 @@ class ScenariosController{
})
/**
* API: GET /api/scenario/:id Retrieve scenario by ID
* API: GET /api/scenario/:id Retrieve scenario by ID, извличане на игрови сценарий
* @function read
* @param {string} id The id of the scenario
* @param {string} id The id of the scenario, идентификатор
* @returns {Scenario}
* @memberof ScenariosController
*/
@@ -45,9 +45,9 @@ class ScenariosController{
})
/**
* API: DELETE /api/scenario/:id Delete scenario by ID
* API: DELETE /api/scenario/:id Delete scenario by ID, изтриване на игрови сценарий
* @function remove
* @param {string} id The id of the scenario
* @param {string} id The id of the scenario, идентификатор
* @memberof ScenariosController
*/
router.delete('/:id', async (req, res)=>{