mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-25 04:11:41 +08:00
优化学员最近学习记录api
This commit is contained in:
@@ -30,4 +30,6 @@ public interface CourseHourService extends IService<CourseHour> {
|
||||
void updateSort(List<Integer> ids, Integer cid);
|
||||
|
||||
List<Integer> getRidsByCourseId(Integer courseId, String type);
|
||||
|
||||
List<CourseHour> chunk(List<Integer> hourIds);
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ public interface UserCourseHourRecordService extends IService<UserCourseHourReco
|
||||
|
||||
List<UserCourseHourRecord> getRecords(Integer userId, Integer courseId);
|
||||
|
||||
List<Integer> getLatestCourseIds(Integer userId, Integer size);
|
||||
List<UserCourseHourRecord> getLatestCourseIds(Integer userId, Integer size);
|
||||
}
|
||||
|
||||
@@ -99,6 +99,11 @@ public class CourseHourServiceImpl extends ServiceImpl<CourseHourMapper, CourseH
|
||||
public List<Integer> getRidsByCourseId(Integer courseId, String type) {
|
||||
return list(query().getWrapper().eq("course_id", courseId).eq("type", type)).stream().map(CourseHour::getRid).toList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CourseHour> chunk(List<Integer> hourIds) {
|
||||
return list(query().getWrapper().in("id", hourIds));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -90,8 +90,8 @@ public class UserCourseHourRecordServiceImpl extends ServiceImpl<UserCourseHourR
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getLatestCourseIds(Integer userId, Integer size) {
|
||||
return getBaseMapper().getLatestCourseIds(userId, size);
|
||||
public List<UserCourseHourRecord> getLatestCourseIds(Integer userId, Integer size) {
|
||||
return getBaseMapper().getUserLatestRecords(userId, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user