SmsConfigController.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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\notice;
  15. use app\adminapi\controller\BaseAdminController;
  16. use app\adminapi\logic\notice\SmsConfigLogic;
  17. use app\adminapi\validate\notice\SmsConfigValidate;
  18. /**
  19. * 短信配置控制器
  20. * Class SmsConfigController
  21. * @package app\adminapi\controller\notice
  22. */
  23. class SmsConfigController extends BaseAdminController
  24. {
  25. /**
  26. * @notes 获取短信配置
  27. * @return \think\response\Json
  28. * @author 段誉
  29. * @date 2022/3/29 11:36
  30. */
  31. public function getConfig()
  32. {
  33. $result = SmsConfigLogic::getConfig();
  34. return $this->data($result);
  35. }
  36. /**
  37. * @notes 短信配置
  38. * @return \think\response\Json
  39. * @author 段誉
  40. * @date 2022/3/29 11:36
  41. */
  42. public function setConfig()
  43. {
  44. $params = (new SmsConfigValidate())->post()->goCheck('setConfig');
  45. SmsConfigLogic::setConfig($params);
  46. return $this->success('操作成功',[],1,1);
  47. }
  48. /**
  49. * @notes 查看短信配置详情
  50. * @return \think\response\Json
  51. * @author 段誉
  52. * @date 2022/3/29 11:36
  53. */
  54. public function detail()
  55. {
  56. $params = (new SmsConfigValidate())->goCheck('detail');
  57. $result = SmsConfigLogic::detail($params);
  58. return $this->data($result);
  59. }
  60. }