From 9911eefd300c7f1a9bb1030b94d03d7562cf7858 Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期二, 08 七月 2025 15:52:29 +0800 Subject: [PATCH] 商品发布 --- buyer-api/src/main/java/cn/lili/controller/lmk/SupplierController.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/buyer-api/src/main/java/cn/lili/controller/lmk/SupplierController.java b/buyer-api/src/main/java/cn/lili/controller/lmk/SupplierController.java new file mode 100644 index 0000000..51248eb --- /dev/null +++ b/buyer-api/src/main/java/cn/lili/controller/lmk/SupplierController.java @@ -0,0 +1,56 @@ +package cn.lili.controller.lmk; + +import cn.lili.common.enums.ResultUtil; +import cn.lili.common.security.context.UserContext; +import cn.lili.common.utils.StringUtils; +import cn.lili.common.vo.ResultMessage; +import cn.lili.modules.goods.entity.vos.CategoryVO; +import cn.lili.modules.goods.service.CategoryService; +import cn.lili.modules.member.entity.dos.Clerk; +import cn.lili.modules.member.service.ClerkService; +import cn.lili.modules.store.service.StoreDetailService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Objects; + +@Validated +@RequiredArgsConstructor +@Api(value = "灏忕▼搴忓晢鎴风鎺ュ彛", tags = "灏忕▼搴忓晢鎴风鎺ュ彛") +@RestController +@RequestMapping("/buyer/lmk/supplier") +public class SupplierController { + /** + * 鍒嗙被 + */ + @Autowired + private CategoryService categoryService; + /** + * 搴楅摵璇︽儏 + */ + @Autowired + private StoreDetailService storeDetailService; + @Autowired + private ClerkService clerkService; + @ApiOperation(value = "鑾峰彇搴楅摵缁忚惀鐨勫垎绫�") + @GetMapping(value = "/allCategery") + public ResultMessage<List<CategoryVO>> getListAll() { + + String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); + if (StringUtils.isEmpty(storeId)) { + Clerk clerk = clerkService.getClerkByMemberId(UserContext.getCurrentUserId()); + storeId = clerk.getStoreId(); + } + + //鑾峰彇搴楅摵缁忚惀鑼冨洿 + String goodsManagementCategory = storeDetailService.getStoreDetail(storeId).getGoodsManagementCategory(); + return ResultUtil.data(this.categoryService.getStoreCategory(goodsManagementCategory.split(","))); + } +} -- Gitblit v1.8.0