This commit is contained in:
wangjinlei
2024-05-09 16:01:48 +08:00
parent e749b9d9b2
commit 7d8f0d85b3
4 changed files with 149 additions and 4 deletions

View File

@@ -3,7 +3,10 @@ package com.peanut.modules.master.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.R;
import com.peanut.modules.common.entity.BookEntity;
import com.peanut.modules.common.entity.ShopProduct;
import com.peanut.modules.common.to.ParamTo;
import com.peanut.modules.common.vo.CourseCatalogueVo;
import com.peanut.modules.master.service.ShopProductService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
@@ -11,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired;
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;
/**
@@ -122,7 +127,6 @@ public class ShopProductController {
return R.ok();
}
@RequestMapping("/bindProductAndMedicineMarket")
public R bindProductAndMedicineMarket(@RequestBody Map<String,String> map){
String[] productIds = map.get("productId").split(",");
@@ -137,15 +141,48 @@ public class ShopProductController {
return R.ok();
}
@RequestMapping("/getProductToLabel")
public R getProductToLabel(@RequestBody Map<String,Integer> map){
Map<String, Object> productId = shopProductService.getProductToLabel(map.get("productId"));
return R.ok().put("data",productId);
}
@RequestMapping("/getHasBindProductAndBook")
public R getHasBindProductAndBook(@RequestBody Map<String,Integer> map){
List<BookEntity> books = shopProductService.getHasBindProductAndBook(map.get("productId"));
return R.ok().put("books",books);
}
@RequestMapping("/getCanBindProductAndBook")
public R getCanBindProductAndBook(@RequestBody ParamTo param){
Page<BookEntity> canBindProductAndBook = shopProductService.getCanBindProductAndBook(param);
return R.ok().put("page",canBindProductAndBook);
}
@RequestMapping("/bindProductAndBook")
public R bindProductAndBook(@RequestBody Map<String,Integer> map){
return shopProductService.bindProductAndBook(map.get("productId"),map.get("bookId"));
}
@RequestMapping("/unbindProductAndBook")
public R unbindProductAndBook(@RequestBody Map<String,Integer> map){
shopProductService.unbindProductAndBook(map.get("productId"),map.get("bookId"));
return R.ok();
}
@RequestMapping("/getHasBindProductAndCourse")
public R getHasBindProductAndCourse(@RequestBody Map<String,Integer> map){
List<CourseCatalogueVo> productId = shopProductService.getHasBindProductAndCourse(map.get("productId"));
return R.ok().put("course",productId);
}
@RequestMapping("/getCanBindProductAndCourse")
public R getCanBindProductAndCourse(@RequestBody ParamTo param){
Page<CourseCatalogueVo> canBindProductAndCourse = shopProductService.getCanBindProductAndCourse(param);
return R.ok().put("page",canBindProductAndCourse);
}
}