MnpSettingsController.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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\MnpSettingsLogic;
  17. use app\adminapi\validate\channel\MnpSettingsValidate;
  18. /**
  19. * 小程序设置
  20. * Class MnpSettingsController
  21. * @package app\adminapi\controller\channel
  22. */
  23. class MnpSettingsController extends BaseAdminController
  24. {
  25. //客户端微信小程序
  26. /**
  27. * @notes 获取小程序配置
  28. * @return \think\response\Json
  29. */
  30. public function getConfig()
  31. {
  32. $result = (new MnpSettingsLogic())->getConfig();
  33. return $this->data($result);
  34. }
  35. /**
  36. * @notes 设置小程序配置
  37. * @return \think\response\Json
  38. */
  39. public function setConfig()
  40. {
  41. $params = (new MnpSettingsValidate())->post()->goCheck();
  42. (new MnpSettingsLogic())->setConfig($params);
  43. return $this->success('操作成功', [], 1, 1);
  44. }
  45. //工程师端微信小程序
  46. /**
  47. * @notes 获取小程序配置
  48. * @return \think\response\Json
  49. */
  50. public function getWorkerConfig()
  51. {
  52. $result = (new MnpSettingsLogic())->getWorkerConfig();
  53. return $this->data($result);
  54. }
  55. /**
  56. * @notes 设置小程序配置
  57. * @return \think\response\Json
  58. */
  59. public function setWorkerConfig()
  60. {
  61. $params = (new MnpSettingsValidate())->post()->goCheck();
  62. (new MnpSettingsLogic())->setWorkerConfig($params);
  63. return $this->success('操作成功', [], 1, 1);
  64. }
  65. }