AddressLibraryController.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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\businessapi\controller;
  20. use app\businessapi\lists\AddressLibraryLists;
  21. use app\businessapi\logic\AddressLibraryLogic;
  22. use app\businessapi\validate\AddressLibraryValidate;
  23. class AddressLibraryController extends BaseBusinesseController
  24. {
  25. /**
  26. * @notes 地址库列表
  27. * @return \think\response\Json
  28. * @author ljj
  29. * @date 2024/9/9 下午2:57
  30. */
  31. public function lists()
  32. {
  33. return $this->dataLists(new AddressLibraryLists());
  34. }
  35. /**
  36. * @notes 新增
  37. * @return \think\response\Json
  38. * @author ljj
  39. * @date 2024/9/9 下午3:18
  40. */
  41. public function add()
  42. {
  43. $params = (new AddressLibraryValidate())->post()->goCheck('add');
  44. (new AddressLibraryLogic())->add($params);
  45. return $this->success('添加成功',[],1,1);
  46. }
  47. /**
  48. * @notes 编辑
  49. * @return \think\response\Json
  50. * @author ljj
  51. * @date 2024/9/9 下午3:29
  52. */
  53. public function edit()
  54. {
  55. $params = (new AddressLibraryValidate())->post()->goCheck('edit');
  56. (new AddressLibraryLogic())->edit($params);
  57. return $this->success('修改成功',[],1,1);
  58. }
  59. /**
  60. * @notes 详情
  61. * @return \think\response\Json
  62. * @author ljj
  63. * @date 2024/9/9 下午3:33
  64. */
  65. public function detail()
  66. {
  67. $params = (new AddressLibraryValidate())->goCheck('detail');
  68. $result = (new AddressLibraryLogic())->detail($params);
  69. return $this->success('',$result);
  70. }
  71. /**
  72. * @notes 删除
  73. * @return \think\response\Json
  74. * @author ljj
  75. * @date 2024/9/9 下午3:40
  76. */
  77. public function del()
  78. {
  79. $params = (new AddressLibraryValidate())->post()->goCheck('del');
  80. (new AddressLibraryLogic())->del($params);
  81. return $this->success('删除成功',[],1,1);
  82. }
  83. /**
  84. * @notes 设置默认地址
  85. * @return \think\response\Json
  86. * @author ljj
  87. * @date 2024/9/9 下午3:53
  88. */
  89. public function default()
  90. {
  91. $params = (new AddressLibraryValidate())->post()->goCheck('default');
  92. (new AddressLibraryLogic())->default($params);
  93. return $this->success('操作成功',[],1,1);
  94. }
  95. }