mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-24 11:49:51 +08:00
完善/user/courses接口 && fixed: 后台学员top10
This commit is contained in:
@@ -6,7 +6,9 @@ import xyz.playedu.api.service.UserCourseRecordService;
|
||||
import xyz.playedu.api.mapper.UserCourseRecordMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
@@ -64,6 +66,14 @@ public class UserCourseRecordServiceImpl extends ServiceImpl<UserCourseRecordMap
|
||||
updateById(updateRecord);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserCourseRecord> chunk(Integer userId, List<Integer> courseIds) {
|
||||
if (courseIds == null || courseIds.size() == 0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return list(query().getWrapper().eq("user_id", userId).in("course_id", courseIds));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,10 +18,7 @@ import xyz.playedu.api.types.paginate.UserPaginateFilter;
|
||||
import xyz.playedu.api.util.HelperUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -163,6 +160,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
||||
|
||||
@Override
|
||||
public List<User> chunks(List<Integer> ids, List<String> fields) {
|
||||
if (ids == null || ids.size() == 0) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return list(query().getWrapper().in("id", ids).select(fields));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user