LotteryController.php 704 B

1234567891011121314151617181920212223242526272829303132333435
  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. */
  12. namespace App\Controller\Api;
  13. use App\Model\User;
  14. use App\Controller\Resource\ApiResource;
  15. use Hyperf\HttpServer\Annotation\AutoController;
  16. /**
  17. * Class IndexController
  18. * @package App\Controller
  19. * @AutoController(prefix="api")
  20. */
  21. class IndexController extends BaseController
  22. {
  23. /**
  24. *
  25. * @return array
  26. */
  27. public function test(){
  28. $user = User::where(['id'=> 1])->first();
  29. return ApiResource::success(1008, $user);
  30. }
  31. }