线上课-学员api返回线上课信息

This commit is contained in:
none 2023-05-08 13:47:34 +08:00
parent d498799a73
commit cedc363f09

View File

@ -15,6 +15,8 @@
*/ */
package xyz.playedu.api.controller.backend; package xyz.playedu.api.controller.backend;
import lombok.SneakyThrows;
import org.apache.commons.collections4.MapUtils; import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
@ -62,6 +64,7 @@ public class CourseUserController {
@BackendPermissionMiddleware(slug = BPermissionConstant.COURSE_USER) @BackendPermissionMiddleware(slug = BPermissionConstant.COURSE_USER)
@GetMapping("/index") @GetMapping("/index")
@SneakyThrows
public JsonResponse index( public JsonResponse index(
@PathVariable(name = "courseId") Integer courseId, @PathVariable(name = "courseId") Integer courseId,
@RequestParam HashMap<String, Object> params) { @RequestParam HashMap<String, Object> params) {
@ -115,6 +118,7 @@ public class CourseUserController {
Collectors.toMap( Collectors.toMap(
UserCourseHourRecordUserCountMapper::getUserId, UserCourseHourRecordUserCountMapper::getUserId,
UserCourseHourRecordUserCountMapper::getTotal))); UserCourseHourRecordUserCountMapper::getTotal)));
data.put("courses", courseService.findOrFail(courseId));
return JsonResponse.data(data); return JsonResponse.data(data);
} }