Просмотр исходного кода

feat(api): 添加游戏测试接口

- 添加 index/game 路由作为游戏测试接口
- 创建 api/game/Index 控制器实现游戏列表功能
- 返回拳魂觉醒游戏的名称、logo和详情链接信息
shichen месяцев назад: 2
Родитель
Сommit
45b4623396
2 измененных файлов с 21 добавлено и 0 удалено
  1. 17 0
      app/controller/api/game/Index.php
  2. 4 0
      route/api.php

+ 17 - 0
app/controller/api/game/Index.php

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+namespace app\controller\api\game;
4
+
5
+class Index
6
+{
7
+    public function list()
8
+    {
9
+        $status = 1;
10
+        $list = [
11
+            'name' => '拳魂觉醒',
12
+            'logo' => 'https://cdn.bjtdba.com/chuxubao/images/2026-06-01/b42af202606010920574809.jpg',
13
+            'url' => 'https://m.xingwan001.com/#/gameDetails?gameId=10245&channelId=10245_1_01',
14
+        ];
15
+        return app('json')->success(['status' => $status, 'list' => $list]);
16
+    }
17
+}

+ 4 - 0
route/api.php

@@ -1415,3 +1415,7 @@ Route::get('/test', 'api.Test/test');
1415 1415
 
1416 1416
 // 1688订阅消息通知(开放平台webhook回调)
1417 1417
 Route::any('alibaba/notify', 'api.AlibabaNotify/notify');
1418
+
1419
+
1420
+// 游戏测试接口
1421
+Route::get('index/game', 'api.game.Index/list');