From 4b1cb74450d178af66b3f87073edb441f6fbc103 Mon Sep 17 00:00:00 2001
From: zepengdev <lzpsmith@outlook.com>
Date: Thu, 26 Jun 2025 22:37:43 +0800
Subject: [PATCH] fix: 分页查询的商品信息包含图片和标签信息

---
 oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreMerchantController.java |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreMerchantController.java b/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreMerchantController.java
index e1eee0a..d1852b3 100644
--- a/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreMerchantController.java
+++ b/oying-system/src/main/java/com/oying/modules/pc/store/rest/StoreMerchantController.java
@@ -3,8 +3,10 @@
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.copier.CopyOptions;
 import cn.hutool.core.collection.ListUtil;
+import cn.hutool.core.util.ObjUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.oying.modules.pc.store.domain.dto.StoreUpdateRequest;
+import com.oying.modules.pc.store.service.StoreQualificationService;
 import com.oying.utils.R;
 import com.oying.modules.pc.store.domain.Store;
 import com.oying.modules.pc.store.domain.dto.StoreCreateRequest;
@@ -43,6 +45,7 @@
 
     private final StoreService storeService;
     private final StoreCreateService storeCreateService;
+    private final StoreQualificationService storeQualificationService;
 
     @GetMapping(value = "/list")
     @ApiOperation("查询所有店铺")
@@ -68,13 +71,24 @@
     @GetMapping(value = "/{storeId}")
     @ApiOperation("查询店铺")
     //@PreAuthorize("@el.check('merchant:store:getById')")
-    public ResponseEntity<?> getById(@PathVariable Long storeId) {
+    public ResponseEntity<?> getStoreById(@PathVariable Long storeId) {
         Store store = storeService.getById(storeId);
         StoreMerchantView view = new StoreMerchantView();
         BeanUtils.copyProperties(store, view);
         return ResponseEntity.ok(R.success(view));
     }
 
+    @GetMapping(value = "/{storeId}/details")
+    @ApiOperation("查询店铺")
+    //@PreAuthorize("@el.check('merchant:store:getById')")
+    public ResponseEntity<?> getStoreDetailsById(@PathVariable Long storeId) {
+        Store store = storeService.getById(storeId);
+        if (ObjUtil.isNotEmpty(store)) {
+            store.setQualifications(storeQualificationService.queryByStoreId(storeId));
+        }
+        return ResponseEntity.ok(R.success(store));
+    }
+
     @PostMapping
     @ApiOperation("创建店铺")
     //@PreAuthorize("@el.check('merchant:store:create')")

--
Gitblit v1.9.3