mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-10-26 22:51:36 +08:00
!12 使用内存缓存
* 后台管理员登录失败次数设置为10次 * 优化代码 * 后台缓存接口新增权限控制 * 移除redis关键字 * Merge branch 'dev' into dev-cache * 优化静态资源访问不存在抛出异常 * 删除redis相关内容 * 移除compose.yml中redis和minio的配置 * changelog * 后台 s3配置 * 后台 s3配置 * 云存储:移除minio;新增阿里云oss,腾讯云cos * 内存缓存替换redis缓存
This commit is contained in:
@@ -15,20 +15,18 @@
|
||||
*/
|
||||
package xyz.playedu.course.bus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import xyz.playedu.common.domain.Department;
|
||||
import xyz.playedu.common.service.DepartmentService;
|
||||
import xyz.playedu.common.service.UserService;
|
||||
import xyz.playedu.common.util.StringUtil;
|
||||
import xyz.playedu.course.service.CourseService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
*
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2023 杭州白书科技有限公司
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
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 杭州白书科技有限公司
|
||||
*
|
||||
* @create 2023/3/20 17:57
|
||||
*/
|
||||
@Component
|
||||
public class CourseCache {
|
||||
|
||||
@Autowired private CourseService courseService;
|
||||
|
||||
private static final String keyTemplate = "course:%d";
|
||||
|
||||
private static final int expire = 3600; // s
|
||||
|
||||
public Course findOrFail(Integer id) throws NotFoundException {
|
||||
String keyName = key(id);
|
||||
if (RedisUtil.exists(keyName)) {
|
||||
return (Course) RedisUtil.get(keyName);
|
||||
}
|
||||
Course course = courseService.findOrFail(id);
|
||||
put(course);
|
||||
return course;
|
||||
}
|
||||
|
||||
public void put(Course course) {
|
||||
RedisUtil.set(key(course.getId()), course, expire);
|
||||
}
|
||||
|
||||
private String key(Integer courseId) {
|
||||
return String.format(keyTemplate, courseId);
|
||||
}
|
||||
}
|
||||
@@ -15,16 +15,14 @@
|
||||
*/
|
||||
package xyz.playedu.course.caches;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import xyz.playedu.common.exception.ServiceException;
|
||||
import xyz.playedu.common.util.RedisUtil;
|
||||
import xyz.playedu.common.util.StringUtil;
|
||||
import xyz.playedu.course.bus.UserBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import xyz.playedu.common.exception.ServiceException;
|
||||
import xyz.playedu.common.util.MemoryCacheUtil;
|
||||
import xyz.playedu.common.util.StringUtil;
|
||||
import xyz.playedu.course.bus.UserBus;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
@@ -43,8 +41,8 @@ public class UserCanSeeCourseCache {
|
||||
public boolean check(Integer userId, Integer courseId, boolean isThrow)
|
||||
throws ServiceException {
|
||||
boolean result;
|
||||
if (RedisUtil.exists(key(userId, courseId))) {
|
||||
String cacheResult = (String) RedisUtil.get(key(userId, courseId));
|
||||
if (MemoryCacheUtil.exists(key(userId, courseId))) {
|
||||
String cacheResult = (String) MemoryCacheUtil.get(key(userId, courseId));
|
||||
result = "1".equals(cacheResult);
|
||||
} else {
|
||||
result = userBus.canSeeCourse(userId, courseId);
|
||||
@@ -57,7 +55,7 @@ public class UserCanSeeCourseCache {
|
||||
}
|
||||
|
||||
public void put(Integer userId, Integer courseId, boolean result) {
|
||||
RedisUtil.set(key(userId, courseId), result ? "1" : "0", expire);
|
||||
MemoryCacheUtil.set(key(userId, courseId), result ? "1" : "0", expire);
|
||||
}
|
||||
|
||||
public void destroy(List<Integer> userIds, Integer courseId) {
|
||||
@@ -66,7 +64,7 @@ public class UserCanSeeCourseCache {
|
||||
for (Integer userId : userIds) {
|
||||
keyList.add(key(userId, courseId));
|
||||
}
|
||||
RedisUtil.del(keyList.toArray(new String[keyList.size()]));
|
||||
MemoryCacheUtil.del(keyList.toArray(new String[keyList.size()]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
package xyz.playedu.course.caches;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import xyz.playedu.common.util.RedisUtil;
|
||||
import xyz.playedu.common.util.MemoryCacheUtil;
|
||||
|
||||
/**
|
||||
* @Author 杭州白书科技有限公司
|
||||
@@ -32,10 +31,10 @@ public class UserLastLearnTimeCache {
|
||||
private static final int expire = 9500; // 9.5s
|
||||
|
||||
public Long get(Integer userId) {
|
||||
return (Long) RedisUtil.hGet(groupName, userId + "");
|
||||
return (Long) MemoryCacheUtil.hGet(groupName, userId + "");
|
||||
}
|
||||
|
||||
public void put(Integer userId, Long timestamp) {
|
||||
RedisUtil.hSet(groupName, userId + "", timestamp);
|
||||
MemoryCacheUtil.hSet(groupName, userId + "", timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,12 +21,10 @@ 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.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName courses
|
||||
|
||||
@@ -21,11 +21,9 @@ 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;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName course_attachment
|
||||
|
||||
@@ -20,11 +20,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName course_attachment_download_log
|
||||
|
||||
@@ -20,10 +20,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName resource_course_category
|
||||
|
||||
@@ -20,11 +20,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName course_chapters
|
||||
|
||||
@@ -20,10 +20,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName course_department
|
||||
|
||||
@@ -21,11 +21,9 @@ 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;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName course_hour
|
||||
|
||||
@@ -20,11 +20,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName user_course_hour_records
|
||||
|
||||
@@ -20,11 +20,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName user_course_records
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
package xyz.playedu.course.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,11 +20,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName user_learn_duration_records
|
||||
|
||||
@@ -20,11 +20,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName user_learn_duration_stats
|
||||
|
||||
@@ -16,14 +16,11 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.common.types.paginate.CourseAttachmentDownloadLogPaginateFiler;
|
||||
import xyz.playedu.course.domain.CourseAttachmentDownloadLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【course_attachment_download_log】的数据库操作Mapper
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.course.domain.CourseAttachment;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.course.domain.CourseCategory;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.course.domain.CourseChapter;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.course.domain.CourseDepartment;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.course.domain.CourseHour;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,14 +16,11 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.common.types.paginate.CoursePaginateFiler;
|
||||
import xyz.playedu.course.domain.Course;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【courses】的数据库操作Mapper
|
||||
|
||||
@@ -16,17 +16,14 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_hour_records】的数据库操作Mapper
|
||||
|
||||
@@ -16,14 +16,11 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.common.types.paginate.UserCourseRecordPaginateFilter;
|
||||
import xyz.playedu.course.domain.UserCourseRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_records】的数据库操作Mapper
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.course.domain.UserLearnDurationRecord;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package xyz.playedu.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import xyz.playedu.course.domain.UserLearnDurationStats;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
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;
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.playedu.common.exception.NotFoundException;
|
||||
import xyz.playedu.course.domain.CourseAttachment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CourseAttachmentService extends IService<CourseAttachment> {
|
||||
|
||||
CourseAttachment findOrFail(Integer id, Integer courseId) throws NotFoundException;
|
||||
|
||||
@@ -16,10 +16,8 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import xyz.playedu.course.domain.CourseCategory;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.playedu.course.domain.CourseCategory;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.playedu.common.exception.NotFoundException;
|
||||
import xyz.playedu.course.domain.CourseChapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【course_chapters】的数据库操作Service
|
||||
|
||||
@@ -16,10 +16,8 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import xyz.playedu.course.domain.CourseDepartment;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.playedu.course.domain.CourseDepartment;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.playedu.common.exception.NotFoundException;
|
||||
import xyz.playedu.course.domain.CourseHour;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【course_hour】的数据库操作Service
|
||||
|
||||
@@ -16,16 +16,14 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【courses】的数据库操作Service
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.playedu.common.types.mapper.UserCourseHourRecordCourseCountMapper;
|
||||
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserCountMapper;
|
||||
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserFirstCreatedAtMapper;
|
||||
@@ -24,8 +24,6 @@ import xyz.playedu.common.types.paginate.PaginationResult;
|
||||
import xyz.playedu.common.types.paginate.UserCourseHourRecordPaginateFilter;
|
||||
import xyz.playedu.course.domain.UserCourseHourRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_hour_records】的数据库操作Service
|
||||
|
||||
@@ -16,13 +16,11 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.playedu.common.types.paginate.PaginationResult;
|
||||
import xyz.playedu.common.types.paginate.UserCourseRecordPaginateFilter;
|
||||
import xyz.playedu.course.domain.UserCourseRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_records】的数据库操作Service
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import xyz.playedu.course.domain.UserLearnDurationRecord;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,10 +16,8 @@
|
||||
package xyz.playedu.course.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import xyz.playedu.course.domain.UserLearnDurationStats;
|
||||
|
||||
import java.util.List;
|
||||
import xyz.playedu.course.domain.UserLearnDurationStats;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
|
||||
@@ -16,9 +16,7 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
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;
|
||||
|
||||
@@ -16,18 +16,15 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import xyz.playedu.common.exception.NotFoundException;
|
||||
import xyz.playedu.course.domain.CourseAttachment;
|
||||
import xyz.playedu.course.mapper.CourseAttachmentMapper;
|
||||
import xyz.playedu.course.service.CourseAttachmentService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CourseAttachmentServiceImpl
|
||||
extends ServiceImpl<CourseAttachmentMapper, CourseAttachment>
|
||||
|
||||
@@ -16,15 +16,12 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import xyz.playedu.course.domain.CourseCategory;
|
||||
import xyz.playedu.course.mapper.CourseCategoryMapper;
|
||||
import xyz.playedu.course.service.CourseCategoryService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【resource_course_category】的数据库操作Service实现
|
||||
|
||||
@@ -16,18 +16,15 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import xyz.playedu.common.exception.NotFoundException;
|
||||
import xyz.playedu.course.domain.CourseChapter;
|
||||
import xyz.playedu.course.mapper.CourseChapterMapper;
|
||||
import xyz.playedu.course.service.CourseChapterService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【course_chapters】的数据库操作Service实现
|
||||
|
||||
@@ -16,15 +16,12 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import xyz.playedu.course.domain.CourseDepartment;
|
||||
import xyz.playedu.course.mapper.CourseDepartmentMapper;
|
||||
import xyz.playedu.course.service.CourseDepartmentService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【course_department】的数据库操作Service实现
|
||||
|
||||
@@ -16,18 +16,15 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import xyz.playedu.common.exception.NotFoundException;
|
||||
import xyz.playedu.course.domain.CourseHour;
|
||||
import xyz.playedu.course.mapper.CourseHourMapper;
|
||||
import xyz.playedu.course.service.CourseHourService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【course_hour】的数据库操作Service实现
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import xyz.playedu.common.exception.NotFoundException;
|
||||
import xyz.playedu.common.types.paginate.CoursePaginateFiler;
|
||||
import xyz.playedu.common.types.paginate.PaginationResult;
|
||||
@@ -35,9 +34,6 @@ 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;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【courses】的数据库操作Service实现
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import xyz.playedu.common.types.mapper.UserCourseHourRecordCourseCountMapper;
|
||||
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserCountMapper;
|
||||
import xyz.playedu.common.types.mapper.UserCourseHourRecordUserFirstCreatedAtMapper;
|
||||
@@ -28,10 +29,6 @@ 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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_hour_records】的数据库操作Service实现
|
||||
|
||||
@@ -16,20 +16,17 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
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 java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_records】的数据库操作Service实现
|
||||
|
||||
@@ -16,18 +16,14 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import xyz.playedu.course.domain.UserLearnDurationRecord;
|
||||
import xyz.playedu.course.mapper.UserLearnDurationRecordMapper;
|
||||
import xyz.playedu.course.service.UserLearnDurationRecordService;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_learn_duration_records】的数据库操作Service实现
|
||||
|
||||
@@ -16,20 +16,15 @@
|
||||
package xyz.playedu.course.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import xyz.playedu.course.domain.UserLearnDurationStats;
|
||||
import xyz.playedu.course.mapper.UserLearnDurationStatsMapper;
|
||||
import xyz.playedu.course.service.UserLearnDurationStatsService;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.stereotype.Service;
|
||||
import xyz.playedu.course.domain.UserLearnDurationStats;
|
||||
import xyz.playedu.course.mapper.UserLearnDurationStatsMapper;
|
||||
import xyz.playedu.course.service.UserLearnDurationStatsService;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
|
||||
Reference in New Issue
Block a user