AddressLibraryController.php 3.2 KB

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