QxSwitchController.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | saiadmin [ saiadmin快速开发框架 ]
  4. // +----------------------------------------------------------------------
  5. // | Author: your name
  6. // +----------------------------------------------------------------------
  7. namespace app\v1\controller\center;
  8. use plugin\saiadmin\basic\BaseController;
  9. use app\v1\logic\center\QxSwitchLogic;
  10. use app\v1\validate\center\QxSwitchValidate;
  11. use support\Request;
  12. use support\Response;
  13. /**
  14. * 权限开关控制器
  15. */
  16. class QxSwitchController extends BaseController
  17. {
  18. /**
  19. * 构造函数
  20. */
  21. public function __construct()
  22. {
  23. $this->logic = new QxSwitchLogic();
  24. $this->validate = new QxSwitchValidate;
  25. parent::__construct();
  26. }
  27. /**
  28. * 数据列表
  29. * @param Request $request
  30. * @return Response
  31. */
  32. public function index(Request $request): Response
  33. {
  34. $where = $request->more([
  35. ['package_name', ''],
  36. ]);
  37. $query = $this->logic->search($where);
  38. $data = $this->logic->getList($query);
  39. return $this->success($data);
  40. }
  41. }