This commit is contained in:
wangjinlei
2024-04-11 11:14:52 +08:00
parent b705aec11d
commit e9064b617d
15 changed files with 63 additions and 8 deletions

View File

@@ -24,6 +24,8 @@ public class UserToCourseEntity {
private Integer days;
private Date updateTime;
private Date startTime;
private Date endTime;

View File

@@ -8,6 +8,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("medicineShopProductMedicineLabelService")
@Service("masterShopProductMedicineLabelService")
public class ShopProductMedicineLabelServiceImpl extends ServiceImpl<ShopProductMedicineLabelDao, ShopProductMedicineLabel> implements ShopProductMedicineLabelService {
}

View File

@@ -8,6 +8,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("medicineShopProductMedicineMarketService")
@Service("masterShopProductMedicineMarketService")
public class ShopProductMedicineMarketServiceImpl extends ServiceImpl<ShopProductMedicineMarketDao, ShopProductMedicineMarket> implements ShopProductMedicineMarketService {
}

View File

@@ -12,7 +12,7 @@ import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Service("sociologyShopProductSociologyLabelService")
@Service("masterShopProductSociologyLabelService")
public class ShopProductSociologyLabelServiceImpl extends ServiceImpl<ShopProductSociologyLabelDao, ShopProductSociologyLabel> implements ShopProductSociologyLabelService {
@Autowired

View File

@@ -12,7 +12,7 @@ import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Service("sociologyShopProductSociologyMarketService")
@Service("masterShopProductSociologyMarketService")
public class ShopProductSociologyMarketServiceImpl extends ServiceImpl<ShopProductSociologyMarketDao, ShopProductSociologyMarket> implements ShopProductSociologyMarketService {
@Autowired

View File

@@ -8,6 +8,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("medicineShopProductToMedicineLabelService")
@Service("masterShopProductToMedicineLabelService")
public class ShopProductToMedicineLabelServiceImpl extends ServiceImpl<ShopProductToMedicineLabelDao, ShopProductToMedicineLabel> implements ShopProductToMedicineLabelService {
}

View File

@@ -8,6 +8,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("medicineShopProductToMedicineMarketService")
@Service("masterShopProductToMedicineMarketService")
public class ShopProductToMedicineMarketServiceImpl extends ServiceImpl<ShopProductToMedicineMarketDao, ShopProductToMedicineMarket> implements ShopProductToMedicineMarketService {
}

View File

@@ -8,6 +8,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("sociologyShopProductToSociologyLabelService")
@Service("masterShopProductToSociologyLabelService")
public class ShopProductToSociologyLabelServiceImpl extends ServiceImpl<ShopProductToSociologyLabelDao, ShopProductToSociologyLabel> implements ShopProductToSociologyLabelService {
}

View File

@@ -8,6 +8,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("sociologyShopProductToSociologyMarketService")
@Service("masterShopProductToSociologyMarketService")
public class ShopProductToSociologyMarketServiceImpl extends ServiceImpl<ShopProductToSociologyMarketDao, ShopProductToSociologyMarket> implements ShopProductToSociologyMarketService {
}

View File

@@ -2,9 +2,13 @@ package com.peanut.modules.sociology.controller;
import com.peanut.common.utils.R;
import com.peanut.modules.common.entity.CourseEntity;
import com.peanut.modules.common.entity.CourseSociologyEntity;
import com.peanut.modules.common.to.ParamTo;
import com.peanut.modules.sociology.service.CourseService;
import com.peanut.modules.sociology.service.CourseSociologyService;
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;
@@ -16,6 +20,10 @@ public class HomeController {
@Autowired
private CourseService courseService;
@Autowired
private CourseSociologyService courseSociologyService;
//首页-我的课程
@RequestMapping("/getMyCourse")
@@ -24,4 +32,13 @@ public class HomeController {
return R.ok().put("myCourse",courseList);
}
@RequestMapping("/getSociologyLabels")
public R getSociologyLabels(@RequestBody ParamTo param){
List<CourseSociologyEntity> sociologyLabels = courseSociologyService.getSociologyLabels(param.getId());
return R.ok().put("labels",sociologyLabels);
}
}

View File

@@ -0,0 +1,11 @@
package com.peanut.modules.sociology.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.common.entity.CourseSociologyEntity;
import java.util.List;
public interface CourseSociologyService extends IService<CourseSociologyEntity> {
List<CourseSociologyEntity> getSociologyLabels(Integer id);
}

View File

@@ -0,0 +1,25 @@
package com.peanut.modules.sociology.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.CourseSociologyDao;
import com.peanut.modules.common.entity.CourseSociologyEntity;
import com.peanut.modules.sociology.service.CourseSociologyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service("sociologyCourseSociologyService")
public class CourseSociologyServiceImpl extends ServiceImpl<CourseSociologyDao, CourseSociologyEntity> implements CourseSociologyService {
@Override
public List<CourseSociologyEntity> getSociologyLabels(Integer id) {
LambdaQueryWrapper<CourseSociologyEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CourseSociologyEntity::getPid,id);
wrapper.orderByAsc(CourseSociologyEntity::getSort);
List<CourseSociologyEntity> list = this.list(wrapper);
return list;
}
}