Solution.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\controller\api;
  3. use app\extra\basic\Base;
  4. use app\extra\dyMini\Relation;
  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 LinFly\Annotation\Attributes\Route\PostMapping;
  10. use support\Request;
  11. use support\Response;
  12. /**
  13. * 解决方案回传
  14. */
  15. #[Controller("/solution")]
  16. class Solution extends Base
  17. {
  18. #[PostMapping("notify")]
  19. public function getSolutionData(Request $request): Response
  20. {
  21. try {
  22. $data = $request->all();
  23. echo getDateFull()."===扩展回调\n";
  24. print_r($data);
  25. return json(['err_no' => 0,"err_tips" => "success"]);
  26. } catch (\Throwable $throwable) {
  27. return error($throwable->getMessage());
  28. }
  29. }
  30. #[GetMapping("test")]
  31. public function setTest()
  32. {
  33. try {
  34. $data = (new Relation)->config($this->getDyConfig())->token()->createOrderFirst(['1865253598118939']);
  35. return success("ok",$data);
  36. } catch (\Throwable $throwable) {
  37. return error($throwable->getMessage());
  38. }
  39. }
  40. }