added: 最近学习api

This commit is contained in:
none
2023-03-27 15:32:35 +08:00
parent b2f72644e0
commit c8182447ba
6 changed files with 92 additions and 20 deletions

View File

@@ -18,4 +18,6 @@ public interface UserCourseHourRecordService extends IService<UserCourseHourReco
Integer getFinishedHourCount(Integer userId, Integer courseId);
List<UserCourseHourRecord> getRecords(Integer userId, Integer courseId);
List<Integer> getLatestCourseIds(Integer userId, Integer size);
}

View File

@@ -87,6 +87,11 @@ public class UserCourseHourRecordServiceImpl extends ServiceImpl<UserCourseHourR
public List<UserCourseHourRecord> getRecords(Integer userId, Integer courseId) {
return list(query().getWrapper().eq("user_id", userId).eq("course_id", courseId));
}
@Override
public List<Integer> getLatestCourseIds(Integer userId, Integer size) {
return getBaseMapper().getLatestCourseIds(userId, size);
}
}