diff --git a/server/routers/gamehub/index.js b/server/routers/gamehub/index.js index 421f656..c40f67b 100644 --- a/server/routers/gamehub/index.js +++ b/server/routers/gamehub/index.js @@ -9,7 +9,7 @@ router.get("/update-like", (request, response) => { }); router.get("/categories", (request, response) => { - response.send(require("./json/categories/success.json")); + response.send(require("./json/home-page-data/all-games.json")); }); router.get("/shopping-cart", (request, response) => { diff --git a/server/routers/gamehub/json/categories/success.json b/server/routers/gamehub/json/categories/success.json index 2d8c489..e69de29 100644 --- a/server/routers/gamehub/json/categories/success.json +++ b/server/routers/gamehub/json/categories/success.json @@ -1,186 +0,0 @@ -{ - "success": true, - "data": { - "games1": [ - { - "id": 1, - "title": "How to Survive", - "price": 259, - "old_price": 500, - "image": "sales_game1", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 2, - "title": "Red Solstice 2 Survivors", - "price": 561, - "image": "sales_game2", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 3, - "title": "Sons Of The Forests", - "price": 820, - "old_price": 1100, - "image": "new_game2", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 4, - "title": "The Witcher 3: Wild Hunt", - "price": 990, - "old_price": 1200, - "image": "leaders_game4", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 5, - "title": "Atomic Heart", - "price": 1200, - "old_price": 2500, - "image": "leaders_game5", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 6, - "title": "Crab Game", - "price": 600, - "old_price": 890, - "image": "leaders_game6", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - } - ], - "games2": [ - { - "id": 7, - "title": "Alpha League", - "price": 299, - "image": "new_game1", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 8, - "title": "Sons Of The Forests", - "price": 820, - "old_price": 1100, - "image": "new_game2", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 9, - "title": "Pacific Drives", - "price": 1799, - "image": "new_game3", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 4, - "title": "The Witcher 3: Wild Hunt", - "price": 990, - "old_price": 1200, - "image": "leaders_game4", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 5, - "title": "Atomic Heart", - "price": 1200, - "old_price": 2500, - "image": "leaders_game5", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 6, - "title": "Crab Game", - "price": 600, - "old_price": 890, - "image": "leaders_game6", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - } - ], - "games3": [ - { - "id": 10, - "title": "Elden Ring", - "price": 3295, - "old_price": 3599, - "image": "leaders_game2", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 11, - "title": "Counter-Strike 2", - "price": 479, - "image": "leaders_game1", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 12, - "title": "PUBG: BATTLEGROUNDS", - "price": 199, - "image": "leaders_game3", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 4, - "title": "The Witcher 3: Wild Hunt", - "price": 990, - "old_price": 1200, - "image": "leaders_game4", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 5, - "title": "Atomic Heart", - "price": 1200, - "old_price": 2500, - "image": "leaders_game5", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - }, - { - "id": 6, - "title": "Crab Game", - "price": 600, - "old_price": 890, - "image": "leaders_game6", - "os": "windows", - "fav1": "star1", - "fav2": "star2" - } - ] -} -} \ No newline at end of file diff --git a/server/routers/gamehub/json/gamepage/success.json b/server/routers/gamehub/json/gamepage/success.json index 281b7e7..c4b9801 100644 --- a/server/routers/gamehub/json/gamepage/success.json +++ b/server/routers/gamehub/json/gamepage/success.json @@ -5,7 +5,7 @@ { "username": "Пользователь1", "text": "Текст комментария 1", - "likes": 9, + "likes": 11, "rating": 8, "date": "2025-03-01T10:00:00Z" }, @@ -19,7 +19,7 @@ { "username": "Пользователь3", "text": "Текст комментария 3", - "likes": 5, + "likes": 2, "rating": 3, "date": "2025-02-01T10:00:00Z" }, diff --git a/server/routers/gamehub/json/home-page-data/all-games.json b/server/routers/gamehub/json/home-page-data/all-games.json index 16b5bc4..1e60edf 100644 --- a/server/routers/gamehub/json/home-page-data/all-games.json +++ b/server/routers/gamehub/json/home-page-data/all-games.json @@ -3,147 +3,197 @@ "data": [ { "id": 1, - "name": "The Witcher 3: Wild Hunt", + "title": "The Witcher 3: Wild Hunt", "image": "game1", - "text": "$10", + "price": 990, + "old_price": 1200, + "os": "windows", "imgPath": "img_top_1", "description": "Эпическая RPG с открытым миром, в которой Геральт из Ривии охотится на монстров и раскрывает политические заговоры.", "category": "RPG" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 2, - "name": "Red Dead Redemption 2", + "title": "Red Dead Redemption 2", "image": "game2", - "text": "$10", + "price": 980, + "old_price": 3800, + "os": "windows", "imgPath": "img_top_2", "description": "Приключенческая игра с открытым миром на Диком Западе, рассказывающая историю Артура Моргана.", "category": "Adventures" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 3, - "name": "Forza Horizon 5", + "title": "Forza Horizon 5", "image": "game3", - "text": "$10", + "price": 1900, + "os": "windows", "imgPath": "img_top_3", "description": "Гоночная игра с огромным открытым миром, действие которой происходит в Мексике.", "category": "Race" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 4, - "name": "Atomic Heart", + "title": "Atomic Heart", "image": "game4", - "text": "$10", + "price": 1200, + "old_price": 2500, + "os": "windows", "imgPath": "img_top_4", "description": "Экшен-шутер с элементами RPG, разворачивающийся в альтернативной Советской России.", "category": "Shooters" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 5, - "name": "Counter-Strike 2", + "title": "Counter-Strike 2", "image": "game5", - "text": "$10", + "price": 479, + "os": "windows", "imgPath": "img_top_5", "description": "Популярный онлайн-шутер с соревновательным геймплеем и тактическими элементами.", "category": "Shooters" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 6, - "name": "Grand Theft Auto V", + "title": "Grand Theft Auto V", "image": "game6", - "text": "$10", + "price": 700, + "os": "windows", "imgPath": "img_top_6", "description": "Игра с открытым миром, где можно погрузиться в криминальный мир Лос-Сантоса.", "category": "Adventures" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 7, - "name": "Assassin’s Creed IV: Black Flag", + "title": "Assassin’s Creed IV: Black Flag", "image": "game7", - "text": "$10", + "price": 1100, + "os": "windows", "imgPath": "img_top_7", "description": "Приключенческая игра о пиратах и морских сражениях в эпоху золотого века пиратства.", "category": "Adventures" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 8, - "name": "Spider-Man", + "title": "Spider-Man", "image": "game8", - "text": "$10", + "price": 3800, + "os": "windows", "imgPath": "img_top_8", "description": "Игра о супергерое Человеке-пауке с захватывающими битвами и паркуром по Нью-Йорку.", "category": "Action" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 9, - "name": "Assassin’s Creed Mirage", + "title": "Assassin’s Creed Mirage", "image": "game9", - "text": "$10", + "price": 1600, + "os": "windows", "imgPath": "img_top_9", "description": "Приключенческая игра с упором на скрытность, вдохновленная классическими частями серии.", "category": "Action" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 10, - "name": "Assassin’s Creed Valhalla", + "title": "Assassin’s Creed Valhalla", "image": "game10", - "text": "$10", + "price": 800, + "old_price": 2200, + "os": "windows", "imgPath": "img_top_10", "description": "RPG с открытым миром о викингах, включающая битвы, исследования и строительство поселений.", "category": "RPG" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 11, - "name": "ARK: Survival Evolved", + "title": "ARK: Survival Evolved", "image": "game11", - "text": "$10", + "price": 790, + "os": "windows", "imgPath": "img_top_11", "description": "Выживание в открытом мире с динозаврами, строительством и многопользовательскими элементами.", "category": "Simulators" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 12, - "name": "FIFA 23", + "title": "FIFA 23", "image": "game12", - "text": "$10", + "price": 3900, + "os": "windows", "imgPath": "img_top_12", "description": "Популярный футбольный симулятор с улучшенной графикой и реалистичным геймплеем.", "category": "Sports" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 13, - "name": "Dirt 5", + "title": "Dirt 5", "image": "game13", - "text": "$10", + "price": 2300, + "os": "windows", "imgPath": "img_top_13", "description": "Аркадная гоночная игра с фокусом на ралли и внедорожных соревнованиях.", "category": "Race" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 14, - "name": "Cyberpunk 2077", + "title": "Cyberpunk 2077", "image": "game14", - "text": "$10", + "price": 3400, + "os": "windows", "imgPath": "img_top_14", "description": "RPG в киберпанк-сеттинге с нелинейным сюжетом и детализированным открытым миром.", "category": "RPG" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 15, - "name": "Age of Empires IV", + "title": "Age of Empires IV", "image": "game15", - "text": "$10", + "price": 3200, + "os": "windows", "imgPath": "img_top_15", "description": "Классическая стратегия в реальном времени с историческими кампаниями.", "category": "Strategies" + ,"fav1": "star1", + "fav2": "star2" }, { "id": 16, - "name": "Civilization VI", + "title": "Civilization VI", "image": "game16", - "text": "$10", + "price": 4200, + "os": "windows", "imgPath": "img_top_16", "description": "Глобальная пошаговая стратегия, в которой игроки строят и развивают цивилизации.", "category": "Strategies" } ] -} +} \ No newline at end of file diff --git a/server/routers/gamehub/json/home-page-data/games-in-cart.json b/server/routers/gamehub/json/home-page-data/games-in-cart.json new file mode 100644 index 0000000..e8fb117 --- /dev/null +++ b/server/routers/gamehub/json/home-page-data/games-in-cart.json @@ -0,0 +1,16 @@ +{ + "success": true, + "data": { + "ids": [ + 3, + 13, + 1, + 10, + 4, + 9, + 15, + 6, + 7 + ] + } +} \ No newline at end of file diff --git a/server/routers/gamehub/json/home-page-data/success.json b/server/routers/gamehub/json/home-page-data/success.json index 17be966..bd83dcb 100644 --- a/server/routers/gamehub/json/home-page-data/success.json +++ b/server/routers/gamehub/json/home-page-data/success.json @@ -3,43 +3,51 @@ "data": { "topSail": [ { + "id": 1, "image": "game1", - "text": "$10", + "price": 1500, "imgPath": "img_top_1" }, { + "id": 2, "image": "game2", - "text": "$10", + "price": 980, "imgPath": "img_top_2" }, { + "id": 3, "image": "game3", - "text": "$10", + "price": 1900, "imgPath": "img_top_3" }, { + "id": 4, "image": "game4", - "text": "$10", + "price": 1200, "imgPath": "img_top_4" }, { + "id": 5, "image": "game5", - "text": "$10", + "price": 479, "imgPath": "img_top_5" }, { + "id": 6, "image": "game6", - "text": "$10", + "price": 700, "imgPath": "img_top_6" }, { + "id": 7, "image": "game7", - "text": "$10", + "price": 1100, "imgPath": "img_top_7" }, { + "id": 8, "image": "game8", - "text": "$10", + "price": 3800, "imgPath": "img_top_8" } ],