main ad
This commit is contained in:
@@ -26,7 +26,8 @@ import java.util.Map;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController("masterCourse")
|
@RestController("masterCourse")
|
||||||
@RequestMapping("master/course")
|
@RequestMapping("master/course")
|
||||||
public class CourseController {
|
public class
|
||||||
|
CourseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CourseService courseService;
|
private CourseService courseService;
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController("masterMainAdController")
|
@RestController("masterMainAdController")
|
||||||
@@ -27,8 +27,8 @@ public class MainAdController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/getMainAdDetail")
|
@RequestMapping("/getMainAdDetail")
|
||||||
public R getMainAdDetail(@RequestParam Integer id){
|
public R getMainAdDetail(@RequestBody Map<String,Integer> map){
|
||||||
MainAdEntity mainAdDetail = mainAdService.getMainAdDetail(id);
|
MainAdEntity mainAdDetail = mainAdService.getMainAdDetail(map.get("id"));
|
||||||
return R.ok().put("detail",mainAdDetail);
|
return R.ok().put("detail",mainAdDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,8 +39,8 @@ public class MainAdController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/delMainAd")
|
@RequestMapping("/delMainAd")
|
||||||
public R delMainAd(@RequestParam Integer id){
|
public R delMainAd(@RequestBody Map<String,Integer> map){
|
||||||
mainAdService.getBaseMapper().deleteById(id);
|
mainAdService.getBaseMapper().deleteById(map.get("id"));
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -210,4 +210,10 @@ public class ShopProductController {
|
|||||||
return shopProductService.unbindProductAndCourse(map.get("productId"),map.get("catalogueId"));
|
return shopProductService.unbindProductAndCourse(map.get("productId"),map.get("catalogueId"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getProductForApp")
|
||||||
|
public R getProductForApp(@RequestBody Map<String,Object> map){
|
||||||
|
Page<ShopProduct> productForApp = shopProductService.getProductForApp(Integer.valueOf(map.get("type").toString()), Integer.valueOf(map.get("page").toString()), Integer.valueOf(map.get("limit").toString()),map.get("keywords").toString());
|
||||||
|
return R.ok().put("page",productForApp);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,5 +57,7 @@ public interface ShopProductService extends IService<ShopProduct> {
|
|||||||
|
|
||||||
R unbindProductAndCourse(int productId,int catalogueId);
|
R unbindProductAndCourse(int productId,int catalogueId);
|
||||||
|
|
||||||
|
Page<ShopProduct> getProductForApp(int type,int page,int limit,String keywords);
|
||||||
|
|
||||||
R delShopProduct(int productId);
|
R delShopProduct(int productId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -300,6 +300,24 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<ShopProduct> getProductForApp(int type, int page, int limit,String keywords) {
|
||||||
|
String sql = "";
|
||||||
|
if(type==0){//疯子读书
|
||||||
|
sql = "select * from shop_product_to_book_market where product_id = shop_product.product_id";
|
||||||
|
} else if (type==1) {//吴门医述
|
||||||
|
sql = "select * from shop_product_to_medicine_market where product_id = shop_product.product_id";
|
||||||
|
}else{
|
||||||
|
sql = "select * from shop_product_to_sociology_market where product_id = shop_product.product_id";
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<ShopProduct> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.exists(sql);
|
||||||
|
wrapper.like(StringUtils.isNotBlank(keywords),ShopProduct::getProductName,keywords);
|
||||||
|
Page<ShopProduct> shopProductPage = this.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
||||||
|
return shopProductPage;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getProductToLabel(Integer productId) {
|
public Map<String, Object> getProductToLabel(Integer productId) {
|
||||||
HashMap<String, Object> flag = new HashMap<>();
|
HashMap<String, Object> flag = new HashMap<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user