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
+9 -9
View File
@@ -1,7 +1,7 @@
import express from 'express';
/**
* GamesController. API for the games manager
* GamesController. API for the games manager, граничен клас за комуникация с модула за игрови дефиниции
*/
class GamesController{
@@ -9,15 +9,15 @@ class GamesController{
route = '/api/game'
/**
* Initializes the GamesController plugin
* @param {App} app The application instance
* Initializes the GamesController plugin, инициализация
* @param {App} app The application instance, апликация
*/
init(app){
const router = express.Router();
const { games } = app;
/**
* API: PUT /api/game/ Create or update game
* API: PUT /api/game/ Create or update game, създаване/обновяване на игрова дефиниция
* @function createOrUpdate
* @memberof GamesController
*/
@@ -26,7 +26,7 @@ class GamesController{
});
/**
* API: POST /api/game/ List games by given criteria
* API: POST /api/game/ List games by given criteria, търсене в игрови дефиниции
* @function list
* @returns {Game[]}
* @memberof GamesController
@@ -35,9 +35,9 @@ class GamesController{
})
/**
* API: GET /api/game/:id Retrieve game by ID
* API: GET /api/game/:id Retrieve game by ID, извличане на игрова дефиниция
* @function read
* @param {string} id The id of the game
* @param {string} id The id of the game, идентификатор на дефиницията
* @returns {Game}
* @memberof GamesController
*/
@@ -45,9 +45,9 @@ class GamesController{
})
/**
* API: DELETE /api/game/:id Delete game by ID
* API: DELETE /api/game/:id Delete game by ID, изтриване на игрова дефиниция
* @function remove
* @param {string} id The id of the game
* @param {string} id The id of the game, идентификатор на дефиницията
* @memberof GamesController
*/
router.delete('/:id', async (req, res)=>{