课程详情api返回学员的课时学习记录

This commit is contained in:
none
2023-03-24 17:23:54 +08:00
parent 4514adb9d0
commit 2b89ed310a
8 changed files with 28 additions and 16 deletions

View File

@@ -10,6 +10,7 @@ import xyz.playedu.api.mapper.UserCourseHourRecordMapper;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* @author tengteng
@@ -81,6 +82,11 @@ public class UserCourseHourRecordServiceImpl extends ServiceImpl<UserCourseHourR
public Integer getFinishedHourCount(Integer userId, Integer courseId) {
return Math.toIntExact(count(query().getWrapper().eq("user_id", userId).eq("course_id", courseId).eq("is_finished", 1)));
}
@Override
public List<UserCourseHourRecord> getRecords(Integer userId, Integer courseId) {
return list(query().getWrapper().eq("user_id", userId).eq("course_id", courseId));
}
}