OfficialAccountMenuController.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\controller\channel;
  15. use app\adminapi\controller\BaseAdminController;
  16. use app\adminapi\logic\channel\OfficialAccountMenuLogic;
  17. /**
  18. * 微信公众号菜单控制器
  19. * Class OfficialAccountMenuController
  20. * @package app\adminapi\controller\channel
  21. */
  22. class OfficialAccountMenuController extends BaseAdminController
  23. {
  24. /**
  25. * @notes 保存菜单
  26. * @return \think\response\Json
  27. * @author 段誉
  28. * @date 2022/3/29 10:41
  29. */
  30. public function save()
  31. {
  32. $params = $this->request->post();
  33. $result = OfficialAccountMenuLogic::save($params);
  34. if(false === $result) {
  35. return $this->fail(OfficialAccountMenuLogic::getError());
  36. }
  37. return $this->success('保存成功',[],1,1);
  38. }
  39. /**
  40. * @notes 保存发布菜单
  41. * @return \think\response\Json
  42. * @author 段誉
  43. * @date 2022/3/29 10:42
  44. */
  45. public function saveAndPublish()
  46. {
  47. $params = $this->request->post();
  48. $result = OfficialAccountMenuLogic::saveAndPublish($params);
  49. if($result) {
  50. return $this->success('保存并发布成功',[],1,1);
  51. }
  52. return $this->fail(OfficialAccountMenuLogic::getError());
  53. }
  54. /**
  55. * @notes 查看菜单详情
  56. * @return \think\response\Json
  57. * @author 段誉
  58. * @date 2022/3/29 10:42
  59. */
  60. public function detail()
  61. {
  62. $result = OfficialAccountMenuLogic::detail();
  63. return $this->data($result);
  64. }
  65. }