CommonController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\v1\controller\center;
  3. use app\v1\logic\center\GameLogic;
  4. use plugin\saiadmin\basic\BaseController;
  5. use app\v1\logic\center\GameMainLogic;
  6. use support\Request;
  7. use support\Response;
  8. /**
  9. * 公共接口管理控制器
  10. */
  11. class CommonController extends BaseController
  12. {
  13. protected $gameMainLogic;
  14. protected $gameLogic;
  15. /**
  16. * 构造函数
  17. */
  18. public function __construct()
  19. {
  20. parent::__construct();
  21. $this->gameMainLogic = new GameMainLogic();
  22. $this->gameLogic = new GameLogic();
  23. }
  24. /**
  25. * 获取主游戏options列表
  26. * @return Response
  27. */
  28. public function getMainGameOptions(Request $request): Response
  29. {
  30. $data = $this->gameMainLogic->getMainGameOptions();
  31. return $this->success($data);
  32. }
  33. /**
  34. * 获取子游戏options列表
  35. * @return Response
  36. */
  37. public function getGameOptions(Request $request): Response
  38. {
  39. $data = $this->gameLogic->getGameOptions();
  40. return $this->success($data);
  41. }
  42. /**
  43. * 获取树形游戏options列表
  44. * @return Response
  45. */
  46. public function getTreeGameOptions(Request $request): Response
  47. {
  48. $data = $this->gameMainLogic->getTreeGameOptions();
  49. return $this->success($data);
  50. }
  51. }