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