Common.php 604 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\controller\common;
  3. use app\extra\basic\Base;
  4. use LinFly\Annotation\Route\Controller;
  5. use LinFly\Annotation\Route\Middleware;
  6. use LinFly\Annotation\Route\Route;
  7. use support\Response;
  8. /**
  9. *
  10. */
  11. #[Controller(prefix: "/api/service")]
  12. class Common extends Base
  13. {
  14. /**
  15. *
  16. */
  17. #[Route(path: "data",methods: "get")]
  18. public function getServiceData(): Response
  19. {
  20. try {
  21. return successTrans("success",[]);
  22. } catch (\Throwable $throwable) {
  23. return error($throwable->getMessage());
  24. }
  25. }
  26. }