Menu.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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\adminapi\controller\wechat;
  12. use app\service\admin\wechat\WechatMenuService;
  13. use core\base\BaseAdminController;
  14. use EasyWeChat\Kernel\Exceptions\InvalidConfigException;
  15. use GuzzleHttp\Exception\GuzzleException;
  16. use think\Response;
  17. /**
  18. * 微信公众号管理菜单
  19. */
  20. class Menu extends BaseAdminController
  21. {
  22. /**
  23. * 菜单信息
  24. * @return Response
  25. */
  26. public function info()
  27. {
  28. $wechat_menu_service = new WechatMenuService();
  29. return success($wechat_menu_service->getInfo());
  30. }
  31. /**
  32. * 设置菜单
  33. * @return Response
  34. * @throws InvalidConfigException
  35. * @throws GuzzleException
  36. */
  37. public function edit()
  38. {
  39. $wechat_menu_service = new WechatMenuService();
  40. $data = $this->request->params([
  41. ['button', []]
  42. ]);
  43. $wechat_menu_service->edit($data['button']);
  44. return success('EDIT_SUCCESS');
  45. }
  46. }