UserController.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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\settings\user;
  20. use app\adminapi\{
  21. controller\BaseAdminController,
  22. logic\settings\user\UserLogic,
  23. validate\settings\user\UserConfigValidate
  24. };
  25. /**
  26. * 设置-用户设置控制器
  27. * Class UserController
  28. * @package app\adminapi\controller\config
  29. */
  30. class UserController extends BaseAdminController
  31. {
  32. /**
  33. * @notes 获取用户设置
  34. * @return \think\response\Json
  35. * @author cjhao
  36. * @date 2021/7/27 17:29
  37. */
  38. public function getConfig()
  39. {
  40. $result = (new UserLogic())->getConfig();
  41. return $this->data($result);
  42. }
  43. /**
  44. * @notes 设置用户设置
  45. * @return \think\response\Json
  46. * @author cjhao
  47. * @date 2021/7/27 17:59
  48. */
  49. public function setConfig()
  50. {
  51. $params = (new UserConfigValidate())->post()->goCheck('user');
  52. (new UserLogic())->setConfig($params);
  53. return $this->success('设置成功',[],1,1);
  54. }
  55. /**
  56. * @notes 获取注册配置
  57. * @return \think\response\Json
  58. * @author cjhao
  59. * @date 2021/9/14 17:11
  60. */
  61. public function getRegisterConfig()
  62. {
  63. $result = (new UserLogic())->getRegisterConfig();
  64. return $this->data($result);
  65. }
  66. /**
  67. * @notes 设置注册配置
  68. * @return \think\response\Json
  69. * @author cjhao
  70. * @date 2021/9/14 17:29
  71. */
  72. public function setRegisterConfig()
  73. {
  74. $params = (new UserConfigValidate())->post()->goCheck('register');
  75. (new UserLogic())->setRegisterConfig($params);
  76. return $this->success('设置成功',[],1,1);
  77. }
  78. /**
  79. * @notes 获取提现配置
  80. * @return \think\response\Json
  81. * @author cjhao
  82. * @date 2021/9/14 17:30
  83. */
  84. public function getWithdrawConfig()
  85. {
  86. $result = (new UserLogic())->getWithdrawConfig();
  87. return $this->data($result);
  88. }
  89. /**
  90. * @notes 提现配置设置
  91. * @return \think\response\Json
  92. * @author cjhao
  93. * @date 2021/9/16 15:13
  94. */
  95. public function setWithdrawConfig()
  96. {
  97. $params = (new UserConfigValidate())->post()->goCheck('withdraw');
  98. (new UserLogic())->setWithdrawConfig($params);
  99. return $this->success('设置成功',[],1,1);
  100. }
  101. }