Mô phỏng dữ liệu cấu hình danh mục trò chơi slot để hiển thị trên giao diện người dùng.
JavaScript
// Cấu hình cục bộ hiển thị danh sách trò chơi slot thabet
const localGameCatalog = [
{ id: "022", title: "Legend Of Hou Yi", genre: "Slot game" },
{ id: "140", title: "Gladi Glory", genre: "Slot game" },
{ id: "081", title: "Galactic Gems", genre: "Slot game" },
{ id: "036", title: "Jungle Delight", genre: "Slot game" }
];
function getGameInfoById(gameId) {
const game = localGameCatalog.find(item => item.id === gameId);
if (!game) {
return { status: "not_found", message: "Trò chơi không tồn tại trong danh mục" };
}
return { status: "ready", data: game };
}
// Ví dụ kiểm tra thông tin trò chơi
const selected = getGameInfoById("022");
console.log(selected.data.title);
JSON
{
"platform": "android",
"games": [
{
"id": "022",
"name": "Legend Of Hou Yi",
"category": "Slot game"
},
{
"id": "140",
"name": "Gladi Glory",
"category": "Slot game"
},
{
"id": "081",
"name": "Galactic Gems",
"category": "Slot game"
},
{
"id": "036",
"name": "Jungle Delight",
"category": "Slot game"
}
]
}