From 12b95a4ef0392330f275f0a9fa9da42bb39bb5bd Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期二, 07 一月 2025 16:10:51 +0800 Subject: [PATCH] add:配置2 --- src/main/java/com/mzl/flower/web/supplier/SupplierSubController.java | 34 +++++++++++++++++++++++++++------- 1 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/mzl/flower/web/supplier/SupplierSubController.java b/src/main/java/com/mzl/flower/web/supplier/SupplierSubController.java index a4d59d9..0307f5d 100644 --- a/src/main/java/com/mzl/flower/web/supplier/SupplierSubController.java +++ b/src/main/java/com/mzl/flower/web/supplier/SupplierSubController.java @@ -5,7 +5,7 @@ import com.mzl.flower.base.R; import com.mzl.flower.base.ReturnDataDTO; import com.mzl.flower.dto.request.supplier.*; -import com.mzl.flower.dto.response.payment.DeliveryOrderItemListDTO; +import com.mzl.flower.dto.response.current.CurrentUserDTO; import com.mzl.flower.dto.response.supplier.SupplierSubVO; import com.mzl.flower.entity.supplier.SupplierSub; import com.mzl.flower.service.supplier.SupplierSubService; @@ -20,7 +20,7 @@ import java.util.List; @RestController -@RequestMapping("/api/supplierSub") +@RequestMapping("/api") @Api(value = "供应商子账号管理", tags = "供应商子账号管理") @Validated @Slf4j @@ -33,7 +33,7 @@ } - @PostMapping("/addOrUpdate") + @PostMapping("/supplierSub/addOrUpdate") @ApiOperation(value = "供应商子账号信息登记、修改", notes = "供应商信息子账号登记、修改") public ResponseEntity<ReturnDataDTO> addOrUpdateSupplier(@Validated @RequestBody SupplierSubDTO dto) { supplierSubService.addOrUpdateSupplier(dto); @@ -41,30 +41,50 @@ } - @GetMapping("/page") + @GetMapping("/supplierSub/page") @ApiOperation(value = "运营端-供应商子账号分页查询", notes = "运营端-供应商子账号分页查询") public ResponseEntity<ReturnDataDTO<Page<SupplierSubVO>>> querySupplier(QuerySupplierSubDTO dto, Page page) { return returnData(R.SUCCESS.getCode(), supplierSubService.querySupplier(dto, page)); } - @GetMapping("/page/isEnable") + @GetMapping("/supplierSub/page/isEnable") @ApiOperation(value = "子账号启用/禁用", notes = "子账号启用/禁用") public ResponseEntity<ReturnDataDTO<String>> isEnable(@NotNull(message = "id不能为空") Long id) { supplierSubService.isEnable(id); return returnData(R.SUCCESS.getCode(), null); } - @PostMapping("/delete/{id}") + @PostMapping("/supplierSub/delete/{id}") @ApiOperation(value = "子账号删除", notes = "子账号删除") public ResponseEntity<ReturnDataDTO> delete(@PathVariable("id") Long id) { supplierSubService.delete(id); return returnData(R.SUCCESS.getCode(), null); } - @GetMapping("/sub/all") + @GetMapping("/supplierSub/sub/all") @ApiOperation(value = "获取当前用户下子账号信息", notes = "获取当前用户下子账号信息") public ResponseEntity<ReturnDataDTO<List<SupplierSub>>> getSubSupplier() { return returnData(R.SUCCESS.getCode(), supplierSubService.getSubSupplier()); } + + @GetMapping("/supplierSub/getById") + @ApiOperation(value = "通过ID查询子账号", notes = "通过ID查询子账号") + public ResponseEntity<ReturnDataDTO<SupplierSub>> getById(@NotNull(message = "id不能为空") Long id) { + SupplierSub supplierSub = supplierSubService.getById(id); + return returnData(R.SUCCESS.getCode(), supplierSub); + } + + @GetMapping("/supplierSub/getSwitchById") + @ApiOperation(value = "子账号切换", notes = "子账号切换") + public ResponseEntity<ReturnDataDTO<CurrentUserDTO>> getSwitchById(@NotNull(message = "id不能为空") Long id, Integer type) { + CurrentUserDTO currentUserDTO = supplierSubService.getSwitchById(id, type); + return returnData(R.SUCCESS.getCode(), currentUserDTO); + } + + @GetMapping("/supplierAccount/all") + @ApiOperation(value = "获取当前用户下所有账号信息", notes = "获取当前用户下所有账号信息") + public ResponseEntity<ReturnDataDTO<List<SupplierSub>>> getSupplierAccount() { + return returnData(R.SUCCESS.getCode(), supplierSubService.getAllSupplier()); + } } -- Gitblit v1.9.3