Home.php 758 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\controller\api;
  3. use app\extra\basic\Base;
  4. use app\extra\dyLife\data\BaseData;
  5. use app\middleware\AuthMiddleware;
  6. use LinFly\Annotation\Attributes\Route\Controller;
  7. use LinFly\Annotation\Attributes\Route\GetMapping;
  8. use LinFly\Annotation\Attributes\Route\Middleware;
  9. use support\Request;
  10. use Webman\RedisQueue\Redis;
  11. #[Controller("/dy/home"),Middleware(AuthMiddleware::class)]
  12. class Home extends Base
  13. {
  14. /**
  15. * @var array|string[]
  16. */
  17. protected array $noNeedLogin = ["getHomeData"];
  18. #[GetMapping("data")]
  19. public function getHomeData(Request $request)
  20. {
  21. try {
  22. return $this->success("ok");
  23. } catch (\Throwable $th) {
  24. return error($th->getMessage());
  25. }
  26. }
  27. }