Page.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\controller\api;
  3. use app\extra\basic\Base;
  4. use LinFly\Annotation\Route\Controller;
  5. use LinFly\Annotation\Route\Route;
  6. use support\Request;
  7. use support\Response;
  8. #[Controller(prefix: "/wx_api/page")]
  9. class Page extends Base
  10. {
  11. #[Route(path: "about",methods: "get")]
  12. public function getAbout(Request $request)
  13. {
  14. try {
  15. } catch (\Throwable $throwable) {
  16. return error($throwable->getMessage());
  17. }
  18. }
  19. #[Route(path: "privacy",methods: "get")]
  20. public function getPrivacy(Request $request)
  21. {
  22. try {
  23. $data = sConf("service.privacy");
  24. return json_encode(['code' => 1,'data' => $data],JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
  25. } catch (\Throwable $throwable) {
  26. return error($throwable->getMessage());
  27. }
  28. }
  29. #[Route(path: "agreements",methods: "get")]
  30. public function getAgreements(Request $request)
  31. {
  32. try {
  33. $data = sConf("service.agreements");
  34. return json_encode(['code' => 1,'data' => $data],JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
  35. } catch (\Throwable $throwable) {
  36. return error($throwable->getMessage());
  37. }
  38. }
  39. }