Diy.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\api\controller\diy;
  12. use app\service\api\diy\AdvService;
  13. use app\service\api\diy\DiyConfigService;
  14. use app\service\api\diy\DiyRouteService;
  15. use app\service\api\diy\DiyService;
  16. use core\base\BaseApiController;
  17. use think\Response;
  18. class Diy extends BaseApiController
  19. {
  20. /**
  21. * 自定义页面信息
  22. * @return Response
  23. */
  24. public function info()
  25. {
  26. $params = $this->request->params([
  27. [ 'id', '' ],
  28. [ 'name', '' ],
  29. [ 'site_id', 0 ]
  30. ]);
  31. return success(( new DiyService() )->getInfo($params));
  32. }
  33. /**
  34. * 底部菜单信息
  35. * @return Response
  36. */
  37. public function tabbarList()
  38. {
  39. $params = $this->request->params([
  40. [ 'key', '' ],
  41. [ 'site_id', 0 ]
  42. ]);
  43. return success(( new DiyConfigService() )->getBottomList($params));
  44. }
  45. /**
  46. * 底部菜单信息
  47. * @return Response
  48. */
  49. public function tabbar()
  50. {
  51. return success(( new DiyConfigService() )->getBottomConfig());
  52. }
  53. /**
  54. * 分享内容
  55. * @return Response
  56. */
  57. public function share()
  58. {
  59. $data = $this->request->params([
  60. [ 'route', '' ],
  61. [ 'params', '' ]
  62. ]);
  63. return success(( new DiyRouteService() )->getShare($data));
  64. }
  65. public function getAdv()
  66. {
  67. $data = $this->request->params([
  68. [ 'ap_key', '' ]
  69. ]);
  70. return success(( new AdvService() )->getInfo($data[ 'ap_key' ]));
  71. }
  72. }