mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-07-26 11:59:31 +08:00
优化代码
This commit is contained in:
parent
51db585796
commit
ea80ddc61a
@ -52,7 +52,6 @@ import java.util.stream.Collectors;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author 杭州白书科技有限公司
|
* @Author 杭州白书科技有限公司
|
||||||
*
|
|
||||||
* @create 2023/2/23 09:48
|
* @create 2023/2/23 09:48
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@ -60,23 +59,32 @@ import java.util.stream.Collectors;
|
|||||||
@RequestMapping("/backend/v1/user")
|
@RequestMapping("/backend/v1/user")
|
||||||
public class UserController {
|
public class UserController {
|
||||||
|
|
||||||
@Autowired private UserService userService;
|
@Autowired
|
||||||
|
private UserService userService;
|
||||||
|
|
||||||
@Autowired private UserDepartmentService userDepartmentService;
|
@Autowired
|
||||||
|
private UserDepartmentService userDepartmentService;
|
||||||
|
|
||||||
@Autowired private DepartmentService departmentService;
|
@Autowired
|
||||||
|
private DepartmentService departmentService;
|
||||||
|
|
||||||
@Autowired private ApplicationContext context;
|
@Autowired
|
||||||
|
private ApplicationContext context;
|
||||||
|
|
||||||
@Autowired private UserCourseHourRecordService userCourseHourRecordService;
|
@Autowired
|
||||||
|
private UserCourseHourRecordService userCourseHourRecordService;
|
||||||
|
|
||||||
@Autowired private UserCourseRecordService userCourseRecordService;
|
@Autowired
|
||||||
|
private UserCourseRecordService userCourseRecordService;
|
||||||
|
|
||||||
@Autowired private CourseHourService courseHourService;
|
@Autowired
|
||||||
|
private CourseHourService courseHourService;
|
||||||
|
|
||||||
@Autowired private CourseService courseService;
|
@Autowired
|
||||||
|
private CourseService courseService;
|
||||||
|
|
||||||
@Autowired private UserLearnDurationStatsService userLearnDurationStatsService;
|
@Autowired
|
||||||
|
private UserLearnDurationStatsService userLearnDurationStatsService;
|
||||||
|
|
||||||
@BackendPermissionMiddleware(slug = BPermissionConstant.USER_INDEX)
|
@BackendPermissionMiddleware(slug = BPermissionConstant.USER_INDEX)
|
||||||
@GetMapping("/index")
|
@GetMapping("/index")
|
||||||
@ -433,7 +441,7 @@ public class UserController {
|
|||||||
.map(UserCourseRecord::getCourseId)
|
.map(UserCourseRecord::getCourseId)
|
||||||
.toList())
|
.toList())
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.groupingBy(Course::getId)));
|
.collect(Collectors.toMap(Course::getId, e -> e)));
|
||||||
|
|
||||||
return JsonResponse.data(data);
|
return JsonResponse.data(data);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user