refactor: 重构抽奖逻辑以支持可验证凭据 feat(redis): 集成Redis客户端并添加配置支持 fix: 修复订单取消时的优惠券和库存处理逻辑 docs: 添加对对碰游戏前端对接指南和示例JSON test: 添加对对碰游戏模拟测试和验证逻辑
128 lines
4.9 KiB
JSON
128 lines
4.9 KiB
JSON
{
|
|
"game_id": "MG1001_FULL_DEMO_2025",
|
|
"initial_board": [
|
|
{ "id": "c1", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" },
|
|
{ "id": "c2", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" },
|
|
{ "id": "c3", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
{ "id": "c4", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
{ "id": "c5", "type": "C", "name": "樱桃", "image_url": "https://example.com/cherry.png" },
|
|
{ "id": "c6", "type": "C", "name": "樱桃", "image_url": "https://example.com/cherry.png" },
|
|
{ "id": "c7", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" },
|
|
{ "id": "c8", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
{ "id": "c9", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" }
|
|
],
|
|
"timeline": [
|
|
{
|
|
"round": 1,
|
|
"board": [
|
|
{ "id": "c1", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" },
|
|
{ "id": "c2", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" },
|
|
{ "id": "c3", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
{ "id": "c4", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
{ "id": "c5", "type": "C", "name": "樱桃", "image_url": "https://example.com/cherry.png" },
|
|
{ "id": "c6", "type": "C", "name": "樱桃", "image_url": "https://example.com/cherry.png" },
|
|
{ "id": "c7", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" },
|
|
{ "id": "c8", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
{ "id": "c9", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" }
|
|
],
|
|
"pairs": [
|
|
{
|
|
"card_type": "A",
|
|
"count": 2,
|
|
"card_ids": ["c1", "c2"],
|
|
"slot_indices": [0, 1]
|
|
}
|
|
],
|
|
"pairs_count": 1,
|
|
"drawn_cards": [
|
|
{
|
|
"slot_index": 0,
|
|
"card": { "id": "c10", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" }
|
|
}
|
|
],
|
|
"reshuffled": false,
|
|
"can_continue": true
|
|
},
|
|
{
|
|
"round": 2,
|
|
"board": [
|
|
{ "id": "c10", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
null,
|
|
{ "id": "c3", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
{ "id": "c4", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
{ "id": "c5", "type": "C", "name": "樱桃", "image_url": "https://example.com/cherry.png" },
|
|
{ "id": "c6", "type": "C", "name": "樱桃", "image_url": "https://example.com/cherry.png" },
|
|
{ "id": "c7", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" },
|
|
{ "id": "c8", "type": "B", "name": "香蕉", "image_url": "https://example.com/banana.png" },
|
|
{ "id": "c9", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" }
|
|
],
|
|
"pairs": [
|
|
{
|
|
"card_type": "B",
|
|
"count": 4,
|
|
"card_ids": ["c10", "c3", "c4", "c8"],
|
|
"slot_indices": [0, 2, 3, 7]
|
|
}
|
|
],
|
|
"pairs_count": 2,
|
|
"drawn_cards": [],
|
|
"reshuffled": false,
|
|
"can_continue": true
|
|
},
|
|
{
|
|
"round": 3,
|
|
"board": [
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
{ "id": "c5", "type": "C", "name": "樱桃", "image_url": "https://example.com/cherry.png" },
|
|
{ "id": "c6", "type": "C", "name": "樱桃", "image_url": "https://example.com/cherry.png" },
|
|
{ "id": "c7", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" },
|
|
null,
|
|
{ "id": "c9", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" }
|
|
],
|
|
"pairs": [
|
|
{
|
|
"card_type": "C",
|
|
"count": 2,
|
|
"card_ids": ["c5", "c6"],
|
|
"slot_indices": [4, 5]
|
|
}
|
|
],
|
|
"pairs_count": 1,
|
|
"drawn_cards": [],
|
|
"reshuffled": false,
|
|
"can_continue": true
|
|
},
|
|
{
|
|
"round": 4,
|
|
"board": [
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
null,
|
|
{ "id": "c7", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" },
|
|
null,
|
|
{ "id": "c9", "type": "A", "name": "苹果", "image_url": "https://example.com/apple.png" }
|
|
],
|
|
"pairs": [
|
|
{
|
|
"card_type": "A",
|
|
"count": 2,
|
|
"card_ids": ["c7", "c9"],
|
|
"slot_indices": [6, 8]
|
|
}
|
|
],
|
|
"pairs_count": 1,
|
|
"drawn_cards": [],
|
|
"reshuffled": false,
|
|
"can_continue": false
|
|
}
|
|
],
|
|
"total_pairs": 5,
|
|
"server_seed_hash": "a1b2c3d4e5f6g7h8i9j0"
|
|
}
|