From 6df16b6ba2a29ebc57b7900c70cb41ae669232ee Mon Sep 17 00:00:00 2001 From: waynaqua <1669738430@qq.com> Date: Thu, 30 Jul 2020 13:33:06 +0800 Subject: [PATCH] =?UTF-8?q?perf(=E5=89=8D=E5=8F=B0):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/GoodsController.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/GoodsController.java diff --git a/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/GoodsController.java b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/GoodsController.java new file mode 100644 index 0000000..d911994 --- /dev/null +++ b/waynboot-mobile-api/src/main/java/com/wayn/mobile/api/controller/GoodsController.java @@ -0,0 +1,37 @@ +package com.wayn.mobile.api.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper; +import com.wayn.common.core.domain.shop.GoodsSpecification; +import com.wayn.common.core.service.shop.IGoodsService; +import com.wayn.common.core.service.shop.IGoodsSpecificationService; +import com.wayn.common.util.R; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.Map; + +@RestController +@RequestMapping("goods") +public class GoodsController { + + @Autowired + private IGoodsService iGoodsService; + + @Autowired + private IGoodsSpecificationService iGoodsSpecificationService; + + @PostMapping("detail") + public R detail(@RequestBody Map map) { + R success = R.success(); + Long goodsId = map.get("goodsId"); + List list = iGoodsSpecificationService.list(new QueryWrapper().eq("goods_id", goodsId)); + success.add("goods", iGoodsService.getById(goodsId)); + success.add("skuList", list); + return success; + } +}