吴门医述-游客模式
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.peanut.modules.sys.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
@@ -8,6 +9,10 @@ import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.dao.ShopProductToLabelDao;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -38,6 +43,16 @@ public class VisitorController {
|
||||
private MyUserService myUserService;
|
||||
@Autowired
|
||||
private UserFollowUpService userFollowUpService;
|
||||
@Autowired
|
||||
private CourseMedicalService medicalService;
|
||||
@Autowired
|
||||
private com.peanut.modules.medical.service.ShopProductService productService;
|
||||
@Autowired
|
||||
private CourseService courseService;
|
||||
@Autowired
|
||||
private MessageService messageService;
|
||||
@Autowired
|
||||
private com.peanut.modules.sociology.service.ShopProductService medicineShopProductService;
|
||||
|
||||
//新书
|
||||
@RequestMapping("/getNewBook")
|
||||
@@ -163,7 +178,54 @@ public class VisitorController {
|
||||
return R.ok().put("list", list);
|
||||
}
|
||||
return R.error("该商品暂无评论");
|
||||
|
||||
}
|
||||
|
||||
//ios
|
||||
//获取医学标签树
|
||||
@RequestMapping("/getCourseMedicalTree")
|
||||
public R getCourseMedicalTree(){
|
||||
List<CourseMedicine> labelsTree = medicalService.getCourseMedicalTree();
|
||||
return R.ok().put("labels",labelsTree);
|
||||
}
|
||||
/**
|
||||
* 营销标签下商品列表
|
||||
*/
|
||||
@RequestMapping("/getMarketShopProductList")
|
||||
public R getToLabelList(@RequestBody Map params){
|
||||
MPJLambdaWrapper<ShopProduct> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.selectAll(ShopProduct.class);
|
||||
wrapper.rightJoin(ShopProductToMedicineMarket.class,ShopProductToMedicineMarket::getProductId,ShopProduct::getProductId);
|
||||
if (params.containsKey("medicineMarketId")&&!"".equals(params.get("medicineMarketId").toString())){
|
||||
wrapper.eq(ShopProductToMedicineMarket::getMedicineMarketId,params.get("medicineMarketId").toString());
|
||||
}
|
||||
Page<ShopProduct> 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("/getMarketCourseList")
|
||||
public R getMarketCourseList(@RequestBody ParamTo param){
|
||||
Page<CourseEntity> marketCourseList = courseService.getMarketCourseList(param);
|
||||
return R.ok().put("courseList",marketCourseList);
|
||||
}
|
||||
|
||||
//消息列表
|
||||
@RequestMapping("/listByPage")
|
||||
public R listByPage(@RequestBody Message message) {
|
||||
LambdaQueryWrapper<Message> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(message.getIsBook()==1,Message::getIsBook,1);
|
||||
wrapper.eq(message.getIsMedical()==1,Message::getIsMedical,1);
|
||||
wrapper.eq(message.getIsSociology()==1,Message::getIsSociology,1);
|
||||
wrapper.orderByDesc(Message::getCreateTime);
|
||||
List<Message> messages = messageService.getBaseMapper().selectList(wrapper);
|
||||
return R.ok().put("messages", messages);
|
||||
}
|
||||
|
||||
//商品详情
|
||||
@RequestMapping("/getProductDetail")
|
||||
public R getProductDetail(@RequestBody Map<String,Integer> map){
|
||||
Map<String, Object> detail = medicineShopProductService.getProductDetail(map.get("productId"));
|
||||
return R.ok().put("data",detail);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user