Просмотр исходного кода

feat(mini): 添加商品列表和详情接口

- 新增 getDiyProductPage 接口用于获取商品列表
- 新增 getProductDetail 接口用于获取商品详情
- 添加接口文档注释和参数说明
hurx 1 день назад
Родитель
Сommit
9233599d72

+ 1 - 4
ruoyi-modules/ruoyi-mall/src/main/java/org/dromara/mall/controller/mini/MiniDiyPageController.java

@@ -7,10 +7,7 @@ import org.dromara.common.web.core.BaseController;
 import org.dromara.mall.domain.NsDiyPage;
 import org.dromara.mall.service.INsDiyPageService;
 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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * mini装修页面

+ 27 - 2
ruoyi-modules/ruoyi-product/src/main/java/org/dromara/product/controller/mini/MiniProductController.java

@@ -1,18 +1,23 @@
 package org.dromara.product.controller.mini;
 
 import lombok.RequiredArgsConstructor;
+import org.dromara.common.core.domain.R;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.product.domain.bo.PcProductBo;
 import org.dromara.product.domain.bo.ProductBaseBo;
 import org.dromara.product.domain.vo.PcProductVo;
+import org.dromara.product.domain.vo.ProductBaseVo;
 import org.dromara.product.service.IProductBaseService;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 /**
  * 首页
+ *
  * @author
  * @date 2026/1/26 下午6:41
  */
@@ -27,9 +32,29 @@ public class MiniProductController {
 
     /**
      * 获取客户商品池的商品
-     * */
+     */
     @GetMapping("/getCustomerProductPage")
-    public TableDataInfo<PcProductVo> getCustomerProductPage(ProductBaseBo productBaseBo, PageQuery pageQuery){
+    public TableDataInfo<PcProductVo> getCustomerProductPage(ProductBaseBo productBaseBo, PageQuery pageQuery) {
         return productBaseService.getSitePoolProductList(productBaseBo, pageQuery);
     }
+
+    /**
+     * mini获取商品列表
+     *
+     * @param bo
+     * @param pageQuery
+     * @return
+     */
+    @GetMapping("/getDiyProductPage")
+    public TableDataInfo<PcProductVo> getDiyProductPage(PcProductBo bo, PageQuery pageQuery) {
+        return productBaseService.getPcProductPage(bo, pageQuery);
+    }
+
+    /**
+     * mini 商品详情
+     */
+    @GetMapping("getProductDetail/{productId}")
+    public R<ProductBaseVo> getProductDetail(@PathVariable Long productId) {
+        return R.ok(productBaseService.queryById(productId));
+    }
 }