Browse Source

店铺管理接口优化

liude 1 year ago
parent
commit
9ddd5f2c5f

+ 12 - 0
src/main/java/com/chelvc/cloud/maintain/controller/CategoryController.java

@@ -6,6 +6,7 @@ import javax.validation.Valid;
 import com.chelvc.cloud.maintain.copier.CategoryCopier;
 import com.chelvc.cloud.maintain.vo.CategoryVO;
 import com.chelvc.cloud.vehicle.client.CategoryClient;
+import com.chelvc.cloud.vehicle.client.dto.CategoryDTO;
 import com.chelvc.cloud.vehicle.client.param.CategoryListParam;
 import com.chelvc.framework.base.annotation.ResponseWrapping;
 import lombok.RequiredArgsConstructor;
@@ -37,4 +38,15 @@ public class CategoryController {
     public List<CategoryVO> listCategories(@RequestBody @Valid CategoryListParam param) {
         return CategoryCopier.INSTANCE.copying(this.categoryClient.listCategory(param));
     }
+
+
+    /**
+     * 获取分类列表
+     *
+     * @return 分类信息列表
+     */
+    @PostMapping("/merchant/getCategories")
+    public List<CategoryDTO> getCategories(@RequestBody @Valid CategoryListParam param) {
+        return this.categoryClient.getRootCategories(param);
+    }
 }

+ 4 - 3
src/main/java/com/chelvc/cloud/maintain/controller/GoodsController.java

@@ -9,6 +9,7 @@ import com.chelvc.cloud.maintain.copier.GoodsCopier;
 import com.chelvc.cloud.maintain.vo.SimpleGoodsVO;
 import com.chelvc.cloud.vehicle.client.FavoriteClient;
 import com.chelvc.cloud.vehicle.client.GoodsClient;
+import com.chelvc.cloud.vehicle.client.dto.GoodsDTO;
 import com.chelvc.cloud.vehicle.client.dto.GoodsDetailDTO;
 import com.chelvc.cloud.vehicle.client.param.GoodsQueryParam;
 import com.chelvc.framework.base.annotation.ResponseWrapping;
@@ -78,9 +79,9 @@ public class GoodsController {
      * @param param 商品信息
      * @return 商家端商品信息
      */
-    @PostMapping("/merchant/goodsList")
-    public Map<String, Object> getMerchantGoodsList(@RequestBody @Valid GoodsQueryParam param) {
-        return this.goodsClient.getCategoryAndGoods(param);
+    @PostMapping("/merchant/getMerchantGoodsList")
+    public List<GoodsDTO> getMerchantGoodsList(@RequestBody @Valid GoodsQueryParam param) {
+        return this.goodsClient.getMerchantGoodsList(param);
     }