1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- declare(strict_types=1);
- /**
- * This file is part of Hyperf.
- *
- * @link https://www.hyperf.io
- * @document https://hyperf.wiki
- * @contact group@hyperf.io
- * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
- */
- use Hyperf\HttpServer\Router\Router;
- use App\Middleware\ApiSign;
- use App\Controller\Api\v1\DemoController;
- use App\Controller\Api\v1\PlayerController;
- use App\Controller\Api\v1\QuestionController;
- use App\Controller\Api\v1\TestController;
- /**
- * Version 1.0
- */
- Router::addGroup('/v1', function () {
- Router::addRoute(['GET','POST'],'/demo', [DemoController::class, 'index']);
- Router::addRoute(['GET','POST'],'/demo/test', [DemoController::class, 'test']);
- Router::addRoute(['GET','POST'],'/test/getrandtoken', [TestController::class, 'getrandtoken']);
- Router::addRoute(['GET','POST'],'/test/test2', [TestController::class, 'test2']);
- /* Router::post('/order/tailwind_driver', [OrderController::class, 'tailwind_driver']);
- Router::post('/home/index', [HomeController::class, 'index']);*/
- // 需登录
- Router::addGroup('/auth', function () {
- Router::post('/player/record', [PlayerController::class, 'record']);
- Router::post('/question/submit', [QuestionController::class, 'submit']);
- Router::post('/question/bindjigou', [QuestionController::class, 'bindjigou']);
- }, ['middleware' => [ApiSign::class]]);
- });
|