吴门医述-首页

This commit is contained in:
wuchunlei
2024-05-17 09:58:34 +08:00
parent 4c8fff6bc0
commit b50293835b
16 changed files with 396 additions and 13 deletions

View File

@@ -1,11 +1,21 @@
package com.peanut.modules.medical.controller;
import com.peanut.common.utils.R;
import com.peanut.common.utils.ShiroUtils;
import com.peanut.modules.common.entity.CourseEntity;
import com.peanut.modules.common.to.ParamTo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Slf4j
@RestController("medicalCourse")
@RequestMapping("medical/course")
public class CourseController {
}

View File

@@ -1,11 +0,0 @@
package com.peanut.modules.medical.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController("medicalCourseMedical")
@RequestMapping("medical/courseMedical")
public class CourseMedicalController {
}

View File

@@ -0,0 +1,74 @@
package com.peanut.modules.medical.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.peanut.common.utils.R;
import com.peanut.common.utils.ShiroUtils;
import com.peanut.modules.common.entity.CourseEntity;
import com.peanut.modules.common.entity.CourseMarketEntity;
import com.peanut.modules.common.entity.CourseMedical;
import com.peanut.modules.common.to.ParamTo;
import com.peanut.modules.medical.service.CourseMarketService;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Slf4j
@RestController("medicalHome")
@RequestMapping("medical/home")
public class HomeController {
@Autowired
private CourseService courseService;
@Autowired
private CourseMedicalService medicalService;
@Autowired
private CourseMarketService courseMarketService;
//获取医学标签列表
@RequestMapping("/getMedicalLabels")
public R getMedicalLabels(@RequestBody ParamTo param){
List<CourseMedical> sociologyLabels = medicalService.getMedicalLabels(param.getId());
return R.ok().put("labels",sociologyLabels);
}
//获取医学标签下的课程列表
@RequestMapping("/getMedicalCourseList")
public R getMedicalCourseList(@RequestBody ParamTo param){
Page medicalCourseList = courseService.getMedicalCourseList(param);
return R.ok().put("courses",medicalCourseList);
}
/**
* 营销标签树
*/
@RequestMapping(path = "/courseMarketTree")
public R courseMarketTree() {
List<CourseMarketEntity> labelsTree = courseMarketService.courseMarketTree();
return R.ok().put("result", labelsTree);
}
//获取营销标签下的课程列表
@RequestMapping("/getMarketCourseList")
public R getMarketCourseList(@RequestBody ParamTo param){
Page<CourseEntity> marketCourseList = courseService.getMarketCourseList(param);
return R.ok().put("courseList",marketCourseList);
}
/**
* 获取用户最近学习课程列表
* @return
*/
@RequestMapping("/getUserLateCourseList")
public R getUserLateCourseList(){
ParamTo param = new ParamTo();
Integer userId = ShiroUtils.getUId();
param.setId(userId);
List<CourseEntity> userLateCourseList = courseService.getUserLateCourseList(param);
return R.ok().put("page",userLateCourseList);
}
}

View File

@@ -1,14 +1,67 @@
package com.peanut.modules.medical.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.*;
import com.peanut.modules.medical.service.ShopProductMedicineLabelService;
import com.peanut.modules.medical.service.ShopProductMedicineMarketService;
import com.peanut.modules.medical.service.ShopProductService;
import lombok.extern.slf4j.Slf4j;
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;
/**
* 医学课程和营销标签
*/
@Slf4j
@RestController
@RequestMapping("book/labelAndMarket")
@RequestMapping("medical/labelAndMarket")
public class MedicalLabelAndMarketController {
@Autowired
private ShopProductMedicineLabelService labelService;
@Autowired
private ShopProductMedicineMarketService marketService;
@Autowired
private ShopProductService productService;
/**
* 分类标签树
*/
@RequestMapping(path = "/labelTree")
public R labelTree() {
List<ShopProductMedicineLabel> labelsTree = labelService.labelTree();
return R.ok().put("result", labelsTree);
}
/**
* 营销标签树
*/
@RequestMapping(path = "/marketTree")
public R marketTree() {
List<ShopProductMedicineMarket> marketsTree = marketService.marketTree();
return R.ok().put("result", marketsTree);
}
/**
* 营销标签下商品列表
*/
@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);
}
}