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 2a5677f3..abf804ad 100644 --- a/src/main/java/com/peanut/modules/sys/controller/VisitorController.java +++ b/src/main/java/com/peanut/modules/sys/controller/VisitorController.java @@ -11,9 +11,9 @@ import com.peanut.modules.book.service.*; import com.peanut.modules.common.entity.*; import com.peanut.modules.common.service.CoursePsycheService; import com.peanut.modules.common.service.MessageService; +import com.peanut.modules.common.service.TaihuWelfareService; import com.peanut.modules.common.to.ParamTo; import com.peanut.modules.master.service.CourseCatalogueService; -import com.peanut.modules.master.service.CourseToSociologyService; import com.peanut.modules.medical.service.CourseMedicalService; import com.peanut.modules.medical.service.CourseService; import com.peanut.modules.sociology.service.CourseCatalogueChapterService; @@ -22,7 +22,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.*; -import java.util.stream.Collectors; @Slf4j @RestController @@ -69,6 +68,8 @@ public class VisitorController { private com.peanut.modules.sociology.service.ShopProductService medicineShopProductService; @Autowired private CoursePsycheService coursePsycheService; + @Autowired + private TaihuWelfareService taihuWelfareService; //新书 @RequestMapping("/getNewBook") @@ -381,4 +382,37 @@ public class VisitorController { List list = courseCatalogueChapterService.list(wrapper); return R.ok().put("list",list); } + + //获取太湖公益的太湖之光文章列表 + @RequestMapping("/getTaihuWelfareArticleList") + public R getTaihuWelfareArticleList(@RequestBody ParamTo param){ + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.orderByAsc(TaihuWelfareEntity::getSort); + Page taihuWelfareEntityPage = taihuWelfareService.page(new Page<>(param.getPage(), + param.getLimit()), wrapper); + return R.ok().put("page",taihuWelfareEntityPage); + } + + //获取太湖之光文章详情 + @RequestMapping("/getTaihuWelfareProductList") + public R getTaihuWelfareProductList(@RequestBody ParamTo param){ + MPJLambdaWrapper wrapper = new MPJLambdaWrapper<>(); + wrapper.selectAll(ShopProduct.class); + wrapper.rightJoin(ShopStoreToProductEntity.class,ShopStoreToProductEntity::getProductId,ShopProduct::getProductId); + wrapper.eq(ShopStoreToProductEntity::getStoreId,1); + wrapper.orderByAsc(ShopStoreToProductEntity::getSort); + Page shopProductPage = shopProductService.page(new Page<>(param.getPage(), param.getLimit()),wrapper); + return R.ok().put("page",shopProductPage); + } + + //获取太湖公益商品 + @RequestMapping("/getTaihuWelfareArticleDetail") + public R getTaihuWelfareArticleDetail(@RequestBody Map map){ + TaihuWelfareEntity byId = taihuWelfareService.getById(map.get("id")); + return R.ok().put("result",byId); + } + + + + }