ExpressController.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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\delivery;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\settings\delivery\ExpressLists;
  22. use app\adminapi\logic\settings\delivery\ExpressLogic;
  23. use app\adminapi\validate\settings\delivery\ExpressValidate;
  24. use app\common\model\Express;
  25. class ExpressController extends BaseAdminController
  26. {
  27. /**
  28. * @notes 添加快递公司
  29. * @return \think\response\Json
  30. * @author ljj
  31. * @date 2021/7/29 4:38 下午
  32. */
  33. public function add()
  34. {
  35. $params = (new ExpressValidate())->post()->goCheck('add');
  36. (new ExpressLogic())->add($params);
  37. return $this->success('添加成功',[],1, 1);
  38. }
  39. /**
  40. * @notes 查看快递公司列表
  41. * @return \think\response\Json
  42. * @author ljj
  43. * @date 2021/7/29 4:41 下午
  44. */
  45. public function lists()
  46. {
  47. return $this->dataLists(new ExpressLists());
  48. }
  49. /**
  50. * @notes 编辑快递公司
  51. * @return \think\response\Json
  52. * @throws \think\db\exception\DataNotFoundException
  53. * @throws \think\db\exception\DbException
  54. * @throws \think\db\exception\ModelNotFoundException
  55. * @author ljj
  56. * @date 2021/7/29 5:43 下午
  57. */
  58. public function edit()
  59. {
  60. $params = (new ExpressValidate())->post()->goCheck('edit');
  61. (new ExpressLogic())->edit($params);
  62. return $this->success('修改成功',[],1,1);
  63. }
  64. /**
  65. * @notes 删除快递公司
  66. * @return \think\response\Json
  67. * @author ljj
  68. * @date 2021/7/29 5:27 下午
  69. */
  70. public function del()
  71. {
  72. $params = (new ExpressValidate())->post()->goCheck('del');
  73. (new ExpressLogic())->del($params);
  74. return $this->success('删除成功',[],1,1);
  75. }
  76. /**
  77. * @notes 查看快递公司详情
  78. * @return \think\response\Json
  79. * @throws \think\db\exception\DataNotFoundException
  80. * @throws \think\db\exception\DbException
  81. * @throws \think\db\exception\ModelNotFoundException
  82. * @author ljj
  83. * @date 2021/7/29 5:43 下午
  84. */
  85. public function detail()
  86. {
  87. $params = (new ExpressValidate())->goCheck('detail');
  88. $result = (new ExpressLogic())->detail($params);
  89. return $this->success('获取成功',$result);
  90. }
  91. }