routes.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. use Hyperf\HttpServer\Router\Router;
  12. use App\Middleware\ApiSign;
  13. use App\Controller\Api\v1\DemoController;
  14. use App\Controller\Api\v1\PlayerController;
  15. use App\Controller\Api\v1\QuestionController;
  16. use App\Controller\Api\v1\TestController;
  17. /**
  18. * Version 1.0
  19. */
  20. Router::addGroup('/v1', function () {
  21. Router::addRoute(['GET','POST'],'/demo', [DemoController::class, 'index']);
  22. Router::addRoute(['GET','POST'],'/demo/test', [DemoController::class, 'test']);
  23. Router::addRoute(['GET','POST'],'/test/getrandtoken', [TestController::class, 'getrandtoken']);
  24. Router::addRoute(['GET','POST'],'/test/test2', [TestController::class, 'test2']);
  25. /* Router::post('/order/tailwind_driver', [OrderController::class, 'tailwind_driver']);
  26. Router::post('/home/index', [HomeController::class, 'index']);*/
  27. // 需登录
  28. Router::addGroup('/auth', function () {
  29. Router::post('/player/record', [PlayerController::class, 'record']);
  30. Router::post('/question/submit', [QuestionController::class, 'submit']);
  31. Router::post('/question/bindjigou', [QuestionController::class, 'bindjigou']);
  32. }, ['middleware' => [ApiSign::class]]);
  33. });