OfficialAccountReplyController.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\controller\wechat;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\logic\wechat\OfficialAccountReplyLogic;
  22. use app\adminapi\validate\wechat\OfficialAccountReplyValidate;
  23. use app\common\enum\OfficialAccountEnum;
  24. /**
  25. * 微信公众号回复控制器
  26. * Class OfficialAccountReplyController
  27. * @package app\adminapi\controller\wechat
  28. */
  29. class OfficialAccountReplyController extends BaseAdminController
  30. {
  31. public array $notNeedLogin = ['index'];
  32. /**
  33. * @notes 查看回复列表(关注/关键词/默认)
  34. * @return \think\response\Json
  35. * @author Tab
  36. * @date 2021/7/29 17:48
  37. */
  38. public function lists()
  39. {
  40. return $this->dataLists();
  41. }
  42. /**
  43. * @notes 添加回复(关注/关键词/默认)
  44. * @author Tab
  45. * @date 2021/7/29 15:55
  46. */
  47. public function add()
  48. {
  49. $params = (new OfficialAccountReplyValidate())->post()->goCheck('add');
  50. $result = OfficialAccountReplyLogic::add($params);
  51. if ($result) {
  52. return $this->success('新增回复成功', [], 1, 1);
  53. }
  54. return $this->fail(OfficialAccountReplyLogic::getError());
  55. }
  56. /**
  57. * @notes 查看回复详情
  58. * @return \think\response\Json
  59. * @author Tab
  60. * @date 2021/7/29 16:53
  61. */
  62. public function detail()
  63. {
  64. $params = (new OfficialAccountReplyValidate())->goCheck('detail');
  65. $result = OfficialAccountReplyLogic::detail($params);
  66. return $this->data($result);
  67. }
  68. /**
  69. * @notes 编辑回复(关注/关键词/默认)
  70. * @return \think\response\Json
  71. * @author Tab
  72. * @date 2021/7/29 17:27
  73. */
  74. public function edit()
  75. {
  76. $params = (new OfficialAccountReplyValidate())->post()->goCheck('edit');
  77. $result = OfficialAccountReplyLogic::edit($params);
  78. if ($result) {
  79. return $this->success('编辑回复成功', [], 1, 1);
  80. }
  81. return $this->fail(OfficialAccountReplyLogic::getError());
  82. }
  83. /**
  84. * @notes 删除回复(关注/关键词/默认)
  85. * @return \think\response\Json
  86. * @author Tab
  87. * @date 2021/7/29 17:44
  88. */
  89. public function delete()
  90. {
  91. $params = (new OfficialAccountReplyValidate())->post()->goCheck('delete');
  92. OfficialAccountReplyLogic::delete($params);
  93. return $this->success('删除回复成功', [], 1, 1);
  94. }
  95. /**
  96. * @notes 更新排序
  97. * @return \think\response\Json
  98. * @author Tab
  99. * @date 2021/7/29 18:11
  100. */
  101. public function sort()
  102. {
  103. $params = (new OfficialAccountReplyValidate())->post()->goCheck('sort');
  104. OfficialAccountReplyLogic::sort($params);
  105. return $this->success('修改成功');
  106. }
  107. /**
  108. * @notes 更新状态
  109. * @author Tab
  110. * @date 2021/9/9 18:27
  111. */
  112. public function status()
  113. {
  114. $params = (new OfficialAccountReplyValidate())->post()->goCheck('status');
  115. OfficialAccountReplyLogic::status($params);
  116. return $this->success('修改成功', [], 1, 1);
  117. }
  118. /**
  119. * @notes 微信公众号回调
  120. * @author Tab
  121. * @date 2021/7/30 11:58
  122. */
  123. public function index()
  124. {
  125. OfficialAccountReplyLogic::index();
  126. }
  127. }