From c44390aa74714dec9f1b76e14b46e339fc3ecf44 Mon Sep 17 00:00:00 2001 From: wuchunlei Date: Tue, 8 Oct 2024 17:05:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=97=E5=A6=99=E4=B9=8B=E9=97=A8=E6=B8=B8?= =?UTF-8?q?=E5=AE=A2=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sys/controller/VisitorController.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/main/java/com/peanut/modules/sys/controller/VisitorController.java b/src/main/java/com/peanut/modules/sys/controller/VisitorController.java index e764ae6a..75969919 100644 --- a/src/main/java/com/peanut/modules/sys/controller/VisitorController.java +++ b/src/main/java/com/peanut/modules/sys/controller/VisitorController.java @@ -13,6 +13,7 @@ import com.peanut.modules.common.service.MessageService; import com.peanut.modules.common.to.ParamTo; import com.peanut.modules.medical.service.CourseMedicalService; import com.peanut.modules.medical.service.CourseService; +import com.peanut.modules.sociology.service.CourseSociologyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -46,10 +47,14 @@ public class VisitorController { @Autowired private CourseMedicalService medicalService; @Autowired + private CourseSociologyService sociologyService; + @Autowired private com.peanut.modules.medical.service.ShopProductService productService; @Autowired private CourseService courseService; @Autowired + private com.peanut.modules.sociology.service.CourseService sociologyCourseService; + @Autowired private MessageService messageService; @Autowired private com.peanut.modules.sociology.service.ShopProductService medicineShopProductService; @@ -228,4 +233,32 @@ public class VisitorController { Map detail = medicineShopProductService.getProductDetail(map.get("productId")); return R.ok().put("data",detail); } + + //获取国学标签树 + @RequestMapping("/getCourseSociologyTree") + public R getCourseSociologyTree(){ + List labelsTree = sociologyService.getCourseSociologyTree(); + return R.ok().put("labels",labelsTree); + } + /** + * 国学营销标签下商品列表 + */ + @RequestMapping("/getSociologyMarketShopProductList") + public R getSociologyMarketShopProductList(@RequestBody Map params){ + MPJLambdaWrapper wrapper = new MPJLambdaWrapper(); + wrapper.selectAll(ShopProduct.class); + wrapper.rightJoin(ShopProductToSociologyMarket.class,ShopProductToSociologyMarket::getProductId,ShopProduct::getProductId); + if (params.containsKey("sociologyMarketId")&&!"".equals(params.get("sociologyMarketId").toString())){ + wrapper.eq(ShopProductToSociologyMarket::getSociologyMarketId,params.get("sociologyMarketId").toString()); + } + Page page = productService.page(new Page<>( + Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper); + return R.ok().put("result", page); + } + //获取国学营销标签下的课程列表 + @RequestMapping("/getSociologyMarketCourseList") + public R getSociologyMarketCourseList(@RequestBody ParamTo param){ + Page marketCourseList = sociologyCourseService.getMarketCourseList(param); + return R.ok().put("courseList",marketCourseList); + } }