Mẫu mã cấu hình danh mục và danh sách trò chơi ban đầu phục vụ kiểm thử giao diện.
{ } clientCatalog.js{ } clientCatalog.json
Sao chép mã
JavaScript
// Cấu hình danh mục game mẫu cho giao diện tân thủ
const clientGameCatalog = {
brand: "bg55" ,
country: "vn" ,
locale: "vi-VN" ,
initialGames: [
{ id: "028" , code: "gem-saviour-sword" , title: "Gem Saviour Sword" , category: "Slot game" },
{ id: "082" , code: "gdn-ice-fire" , title: "Gdn Ice Fire" , category: "Slot game" },
{ id: "104" , code: "lgd-monkey-kg" , title: "Lgd Monkey Kg" , category: "Slot game" },
{ id: "058" , code: "candy-burst" , title: "Candy Burst" , category: "Slot game" },
{ id: "041" , code: "the-great-icescape" , title: "The Great Icescape" , category: "Slot game" }
],
filterByCategory: function (categoryName) {
return this.initialGames.filter(item => item.category === categoryName);
}
};
console.log("bg55 game list ready:" , clientGameCatalog.filterByCategory("Slot game" ).length); JSON
{
"brand" : "bg55" ,
"country" : "vn" ,
"locale" : "vi-VN" ,
"initialGames" : [
{
"id" : "028" ,
"code" : "gem-saviour-sword" ,
"title" : "Gem Saviour Sword" ,
"category" : "Slot game"
},
{
"id" : "082" ,
"code" : "gdn-ice-fire" ,
"title" : "Gdn Ice Fire" ,
"category" : "Slot game"
},
{
"id" : "104" ,
"code" : "lgd-monkey-kg" ,
"title" : "Lgd Monkey Kg" ,
"category" : "Slot game"
},
{
"id" : "058" ,
"code" : "candy-burst" ,
"title" : "Candy Burst" ,
"category" : "Slot game"
},
{
"id" : "041" ,
"code" : "the-great-icescape" ,
"title" : "The Great Icescape" ,
"category" : "Slot game"
}
]
}