mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-07-23 17:49:34 +08:00
新增:后台学员线上课课时的学习详情api
This commit is contained in:
parent
d91b3ac20d
commit
11fc4e4c3f
2
pom.xml
2
pom.xml
@ -10,7 +10,7 @@
|
||||
</parent>
|
||||
<groupId>xyz.playedu</groupId>
|
||||
<artifactId>playedu-api</artifactId>
|
||||
<version>0.1-beta.1</version>
|
||||
<version>1.0-beta.4</version>
|
||||
<name>playedu-api</name>
|
||||
<description>playedu-api</description>
|
||||
<properties>
|
||||
|
@ -370,7 +370,7 @@ public class UserController {
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.USER_LEARN)
|
||||
@GetMapping("/{id}/learn-hours")
|
||||
@SneakyThrows
|
||||
public JsonResponse latestLearnHours(
|
||||
public JsonResponse learnHours(
|
||||
@PathVariable(name = "id") Integer id, @RequestParam HashMap<String, Object> params) {
|
||||
Integer page = MapUtils.getInteger(params, "page", 1);
|
||||
Integer size = MapUtils.getInteger(params, "size", 10);
|
||||
@ -405,7 +405,7 @@ public class UserController {
|
||||
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.USER_LEARN)
|
||||
@GetMapping("/{id}/learn-courses")
|
||||
public JsonResponse latestLearnCourses(
|
||||
public JsonResponse learnCourses(
|
||||
@PathVariable(name = "id") Integer id, @RequestParam HashMap<String, Object> params) {
|
||||
Integer page = MapUtils.getInteger(params, "page", 1);
|
||||
Integer size = MapUtils.getInteger(params, "size", 10);
|
||||
@ -438,6 +438,27 @@ public class UserController {
|
||||
return JsonResponse.data(data);
|
||||
}
|
||||
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.USER_LEARN)
|
||||
@GetMapping("/{id}/learn-course/{courseId}")
|
||||
@SneakyThrows
|
||||
public JsonResponse learnCourseDetail(
|
||||
@PathVariable(name = "id") Integer id,
|
||||
@PathVariable(name = "courseId") Integer courseId) {
|
||||
// 读取线上课下的所有课时
|
||||
List<CourseHour> hours = courseHourService.getHoursByCourseId(courseId);
|
||||
// 读取学员的课时学习记录
|
||||
List<UserCourseHourRecord> records = userCourseHourRecordService.getRecords(id, courseId);
|
||||
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("hours", hours);
|
||||
data.put(
|
||||
"learn_records",
|
||||
records.stream()
|
||||
.collect(Collectors.toMap(UserCourseHourRecord::getHourId, e -> e)));
|
||||
|
||||
return JsonResponse.data(data);
|
||||
}
|
||||
|
||||
@BackendPermissionMiddleware(slug = BPermissionConstant.USER_LEARN)
|
||||
@GetMapping("/{id}/learn-stats")
|
||||
@SneakyThrows
|
||||
|
Loading…
x
Reference in New Issue
Block a user