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