主页-我的课程
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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> {
|
||||
}
|
||||
@@ -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> {
|
||||
}
|
||||
@@ -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> {
|
||||
}
|
||||
@@ -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> {
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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 {
|
||||
}
|
||||
@@ -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 {
|
||||
}
|
||||
Reference in New Issue
Block a user