This commit is contained in:
xxx
2023-08-27 10:05:18 +08:00
parent 54abd4ae6c
commit 30806bfdcf
93 changed files with 240 additions and 178 deletions

View File

@@ -18,6 +18,7 @@ package xyz.playedu.course.bus;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import xyz.playedu.common.domain.User;
import xyz.playedu.common.service.UserService;
import xyz.playedu.course.domain.Course;
@@ -51,7 +52,7 @@ public class UserBus {
}
// 注意,调用该方法需要考虑到并发写入问题
/* public void userLearnDurationRecord(User user, Course course, CourseHour hour) {
/* public void userLearnDurationRecord(User user, Course course, CourseHour hour) {
Long curTime = System.currentTimeMillis();
// 最近一次学习时间

View File

@@ -17,12 +17,12 @@ package xyz.playedu.course.caches;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import xyz.playedu.common.exception.NotFoundException;
import xyz.playedu.common.util.RedisUtil;
import xyz.playedu.course.domain.Course;
import xyz.playedu.course.service.CourseService;
/**
* @Author 杭州白书科技有限公司
*

View File

@@ -16,8 +16,8 @@
package xyz.playedu.course.caches;
import org.springframework.stereotype.Component;
import xyz.playedu.common.util.RedisUtil;
import xyz.playedu.common.util.RedisUtil;
/**
* @Author 杭州白书科技有限公司

View File

@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.io.Serializable;

View File

@@ -19,7 +19,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
* @Author 杭州白书科技有限公司
*

View File

@@ -19,8 +19,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import xyz.playedu.course.domain.CourseAttachmentDownloadLog;
import xyz.playedu.common.types.paginate.CourseAttachmentDownloadLogPaginateFiler;
import xyz.playedu.course.domain.CourseAttachmentDownloadLog;
import java.util.List;

View File

@@ -19,8 +19,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import xyz.playedu.course.domain.Course;
import xyz.playedu.common.types.paginate.CoursePaginateFiler;
import xyz.playedu.course.domain.Course;
import java.util.List;

View File

@@ -19,11 +19,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import xyz.playedu.course.domain.UserCourseHourRecord;
import xyz.playedu.common.types.mapper.UserCourseHourRecordCourseCountMapper;
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserCountMapper;
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserFirstCreatedAtMapper;
import xyz.playedu.common.types.paginate.UserCourseHourRecordPaginateFilter;
import xyz.playedu.course.domain.UserCourseHourRecord;
import java.util.List;

View File

@@ -19,8 +19,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import xyz.playedu.course.domain.UserCourseRecord;
import xyz.playedu.common.types.paginate.UserCourseRecordPaginateFilter;
import xyz.playedu.course.domain.UserCourseRecord;
import java.util.List;

View File

@@ -19,9 +19,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.stereotype.Service;
import xyz.playedu.course.domain.CourseAttachmentDownloadLog;
import xyz.playedu.common.types.paginate.CourseAttachmentDownloadLogPaginateFiler;
import xyz.playedu.common.types.paginate.PaginationResult;
import xyz.playedu.course.domain.CourseAttachmentDownloadLog;
@Service
public interface CourseAttachmentDownloadLogService extends IService<CourseAttachmentDownloadLog> {

View File

@@ -17,8 +17,8 @@ package xyz.playedu.course.service;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.playedu.course.domain.CourseAttachment;
import xyz.playedu.common.exception.NotFoundException;
import xyz.playedu.course.domain.CourseAttachment;
import java.util.List;

View File

@@ -37,6 +37,4 @@ public interface CourseCategoryService extends IService<CourseCategory> {
List<Integer> getCategoryIdsByCourseId(Integer courseId);
List<Integer> getCourseIdsByCategoryId(Integer id);
}

View File

@@ -17,8 +17,8 @@ package xyz.playedu.course.service;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.playedu.course.domain.CourseChapter;
import xyz.playedu.common.exception.NotFoundException;
import xyz.playedu.course.domain.CourseChapter;
import java.util.List;

View File

@@ -17,8 +17,8 @@ package xyz.playedu.course.service;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.playedu.course.domain.CourseHour;
import xyz.playedu.common.exception.NotFoundException;
import xyz.playedu.course.domain.CourseHour;
import java.util.List;

View File

@@ -17,10 +17,10 @@ package xyz.playedu.course.service;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.playedu.course.domain.Course;
import xyz.playedu.common.exception.NotFoundException;
import xyz.playedu.common.types.paginate.CoursePaginateFiler;
import xyz.playedu.common.types.paginate.PaginationResult;
import xyz.playedu.course.domain.Course;
import java.util.List;
import java.util.Map;

View File

@@ -17,12 +17,12 @@ package xyz.playedu.course.service;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.playedu.course.domain.UserCourseHourRecord;
import xyz.playedu.common.types.mapper.UserCourseHourRecordCourseCountMapper;
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserCountMapper;
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserFirstCreatedAtMapper;
import xyz.playedu.common.types.paginate.PaginationResult;
import xyz.playedu.common.types.paginate.UserCourseHourRecordPaginateFilter;
import xyz.playedu.course.domain.UserCourseHourRecord;
import java.util.List;

View File

@@ -17,9 +17,9 @@ package xyz.playedu.course.service;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.playedu.course.domain.UserCourseRecord;
import xyz.playedu.common.types.paginate.PaginationResult;
import xyz.playedu.common.types.paginate.UserCourseRecordPaginateFilter;
import xyz.playedu.course.domain.UserCourseRecord;
import java.util.List;

View File

@@ -19,11 +19,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import xyz.playedu.common.types.paginate.CourseAttachmentDownloadLogPaginateFiler;
import xyz.playedu.common.types.paginate.PaginationResult;
import xyz.playedu.course.domain.CourseAttachmentDownloadLog;
import xyz.playedu.course.mapper.CourseAttachmentDownloadLogMapper;
import xyz.playedu.course.service.CourseAttachmentDownloadLogService;
import xyz.playedu.common.types.paginate.CourseAttachmentDownloadLogPaginateFiler;
import xyz.playedu.common.types.paginate.PaginationResult;
@Service
public class CourseAttachmentDownloadLogServiceImpl

View File

@@ -19,8 +19,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import xyz.playedu.course.domain.CourseAttachment;
import xyz.playedu.common.exception.NotFoundException;
import xyz.playedu.course.domain.CourseAttachment;
import xyz.playedu.course.mapper.CourseAttachmentMapper;
import xyz.playedu.course.service.CourseAttachmentService;

View File

@@ -31,8 +31,7 @@ import java.util.List;
* @createDate 2023-03-09 09:54:22
*/
@Service
public class CourseCategoryServiceImpl
extends ServiceImpl<CourseCategoryMapper, CourseCategory>
public class CourseCategoryServiceImpl extends ServiceImpl<CourseCategoryMapper, CourseCategory>
implements CourseCategoryService {
@Override
@@ -61,8 +60,7 @@ public class CourseCategoryServiceImpl
@Override
public List<Integer> getCourseIdsByCategoryId(Integer id) {
return list(query().getWrapper().eq("category_id", id))
.stream()
return list(query().getWrapper().eq("category_id", id)).stream()
.map(CourseCategory::getCourseId)
.toList();
}

View File

@@ -19,8 +19,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import xyz.playedu.course.domain.CourseChapter;
import xyz.playedu.common.exception.NotFoundException;
import xyz.playedu.course.domain.CourseChapter;
import xyz.playedu.course.mapper.CourseChapterMapper;
import xyz.playedu.course.service.CourseChapterService;

View File

@@ -55,8 +55,7 @@ public class CourseDepartmentServiceImpl
@Override
public List<Integer> getCourseIdsByDepId(Integer depId) {
return list(query().getWrapper().eq("dep_id", depId))
.stream()
return list(query().getWrapper().eq("dep_id", depId)).stream()
.map(CourseDepartment::getCourseId)
.toList();
}

View File

@@ -19,8 +19,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import xyz.playedu.course.domain.CourseHour;
import xyz.playedu.common.exception.NotFoundException;
import xyz.playedu.course.domain.CourseHour;
import xyz.playedu.course.mapper.CourseHourMapper;
import xyz.playedu.course.service.CourseHourService;

View File

@@ -21,16 +21,16 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import xyz.playedu.course.domain.Course;
import xyz.playedu.course.domain.CourseDepartment;
import xyz.playedu.course.domain.CourseCategory;
import xyz.playedu.common.exception.NotFoundException;
import xyz.playedu.course.mapper.CourseMapper;
import xyz.playedu.course.service.CourseDepartmentService;
import xyz.playedu.course.service.CourseService;
import xyz.playedu.course.service.CourseCategoryService;
import xyz.playedu.common.types.paginate.CoursePaginateFiler;
import xyz.playedu.common.types.paginate.PaginationResult;
import xyz.playedu.course.domain.Course;
import xyz.playedu.course.domain.CourseCategory;
import xyz.playedu.course.domain.CourseDepartment;
import xyz.playedu.course.mapper.CourseMapper;
import xyz.playedu.course.service.CourseCategoryService;
import xyz.playedu.course.service.CourseDepartmentService;
import xyz.playedu.course.service.CourseService;
import java.util.*;
import java.util.stream.Collectors;
@@ -271,8 +271,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
data.forEach(
(courseId, records) -> {
result.put(
courseId,
records.stream().map(CourseCategory::getCategoryId).toList());
courseId, records.stream().map(CourseCategory::getCategoryId).toList());
});
return result;
}

View File

@@ -19,14 +19,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import xyz.playedu.course.domain.UserCourseHourRecord;
import xyz.playedu.course.mapper.UserCourseHourRecordMapper;
import xyz.playedu.course.service.UserCourseHourRecordService;
import xyz.playedu.common.types.mapper.UserCourseHourRecordCourseCountMapper;
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserCountMapper;
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserFirstCreatedAtMapper;
import xyz.playedu.common.types.paginate.PaginationResult;
import xyz.playedu.common.types.paginate.UserCourseHourRecordPaginateFilter;
import xyz.playedu.course.domain.UserCourseHourRecord;
import xyz.playedu.course.mapper.UserCourseHourRecordMapper;
import xyz.playedu.course.service.UserCourseHourRecordService;
import java.util.ArrayList;
import java.util.Date;

View File

@@ -19,11 +19,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import xyz.playedu.common.types.paginate.PaginationResult;
import xyz.playedu.common.types.paginate.UserCourseRecordPaginateFilter;
import xyz.playedu.course.domain.UserCourseRecord;
import xyz.playedu.course.mapper.UserCourseRecordMapper;
import xyz.playedu.course.service.UserCourseRecordService;
import xyz.playedu.common.types.paginate.PaginationResult;
import xyz.playedu.common.types.paginate.UserCourseRecordPaginateFilter;
import java.util.ArrayList;
import java.util.Date;