主页-我的课程

This commit is contained in:
wuchunlei
2024-04-11 09:05:34 +08:00
parent fe14ece2a3
commit b705aec11d
68 changed files with 1772 additions and 4 deletions

View File

@@ -1,4 +1,14 @@
package com.peanut.modules.sociology.service;
public interface CourseService {
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.common.entity.CourseEntity;
import java.util.List;
public interface CourseService extends IService<CourseEntity> {
List<CourseEntity> getMyCourse(String userId);
List<CourseEntity> getCourseListBySociology(String sociologyId);
}

View File

@@ -0,0 +1,7 @@
package com.peanut.modules.sociology.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.common.entity.ShopProductSociologyLabel;
public interface ShopProductSociologyLabelService extends IService<ShopProductSociologyLabel> {
}

View File

@@ -0,0 +1,7 @@
package com.peanut.modules.sociology.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.common.entity.ShopProductSociologyMarket;
public interface ShopProductSociologyMarketService extends IService<ShopProductSociologyMarket> {
}

View File

@@ -0,0 +1,7 @@
package com.peanut.modules.sociology.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.common.entity.ShopProductToSociologyLabel;
public interface ShopProductToSociologyLabelService extends IService<ShopProductToSociologyLabel> {
}

View File

@@ -0,0 +1,7 @@
package com.peanut.modules.sociology.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.peanut.modules.common.entity.ShopProductToSociologyMarket;
public interface ShopProductToSociologyMarketService extends IService<ShopProductToSociologyMarket> {
}

View File

@@ -0,0 +1,51 @@
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.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.modules.common.dao.CourseDao;
import com.peanut.modules.common.dao.CourseToSociologyDao;
import com.peanut.modules.common.dao.UserToCourseDao;
import com.peanut.modules.common.entity.CourseEntity;
import com.peanut.modules.common.entity.CourseToSociologyEntity;
import com.peanut.modules.common.entity.UserToCourseEntity;
import com.peanut.modules.sociology.service.CourseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service("sociologyCourseService")
public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> implements CourseService {
@Autowired
public UserToCourseDao userToCourseDao;
@Autowired
public CourseToSociologyDao courseToSociologyDao;
//我的课程
@Override
public List<CourseEntity> getMyCourse(String userId) {
MPJLambdaWrapper<UserToCourseEntity> wrapper = new MPJLambdaWrapper();
wrapper.selectAll(CourseEntity.class);
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId,UserToCourseEntity::getCourseId);
wrapper.groupBy(UserToCourseEntity::getCourseId);
wrapper.eq(UserToCourseEntity::getUserId,userId);
List courseList = userToCourseDao.selectMaps(wrapper);
return courseList;
}
//根据标签获取课程列表
@Override
public List<CourseEntity> getCourseListBySociology(String sociologyId) {
MPJLambdaWrapper<CourseToSociologyEntity> wrapper = new MPJLambdaWrapper();
wrapper.selectAll(CourseEntity.class);
wrapper.leftJoin(CourseEntity.class,CourseEntity::getId,CourseToSociologyEntity::getCourseId);
List courseList = courseToSociologyDao.selectMaps(wrapper);
return courseList;
}
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.sociology.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductSociologyLabelDao;
import com.peanut.modules.common.entity.ShopProductSociologyLabel;
import com.peanut.modules.sociology.service.ShopProductSociologyLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("sociologyShopProductSociologyLabelService")
public class ShopProductSociologyLabelServiceImpl extends ServiceImpl<ShopProductSociologyLabelDao, ShopProductSociologyLabel> implements ShopProductSociologyLabelService {
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.sociology.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductSociologyMarketDao;
import com.peanut.modules.common.entity.ShopProductSociologyMarket;
import com.peanut.modules.sociology.service.ShopProductSociologyMarketService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("sociologyShopProductSociologyMarketService")
public class ShopProductSociologyMarketServiceImpl extends ServiceImpl<ShopProductSociologyMarketDao, ShopProductSociologyMarket> implements ShopProductSociologyMarketService {
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.sociology.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductToSociologyLabelDao;
import com.peanut.modules.common.entity.ShopProductToSociologyLabel;
import com.peanut.modules.sociology.service.ShopProductToSociologyLabelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("sociologyShopProductToSociologyLabelService")
public class ShopProductToSociologyLabelServiceImpl extends ServiceImpl<ShopProductToSociologyLabelDao, ShopProductToSociologyLabel> implements ShopProductToSociologyLabelService {
}

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.sociology.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.peanut.modules.common.dao.ShopProductToSociologyMarketDao;
import com.peanut.modules.common.entity.ShopProductToSociologyMarket;
import com.peanut.modules.sociology.service.ShopProductToSociologyMarketService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@Slf4j
@Service("sociologyShopProductToSociologyMarketService")
public class ShopProductToSociologyMarketServiceImpl extends ServiceImpl<ShopProductToSociologyMarketDao, ShopProductToSociologyMarket> implements ShopProductToSociologyMarketService {
}