|
@@ -44,13 +44,13 @@ public class RecommendController {
|
|
|
|
|
|
List<RecommendVo> result = new ArrayList<>();
|
|
|
|
|
|
- //查询浏览历史课程ID,已去重
|
|
|
+ //查询浏览历史课程ID,已去重,排序
|
|
|
List<String> pids = eventService.getCoursesFromLogs(user.getUid());
|
|
|
if(pids != null && pids.size() > 0){
|
|
|
log.info("get course ids from logs, courseIds={}", pids);
|
|
|
//如果有浏览历史,提取浏览历史前五展示 (目前推荐位为5)
|
|
|
pids.forEach(pid -> {
|
|
|
- if(result.size() <= RECOMMEND_NUM){
|
|
|
+ if(result.size() < RECOMMEND_NUM){
|
|
|
Course course = productService.getCourse(pid);
|
|
|
if(course != null){
|
|
|
/*RecommendVo vo = new RecommendVo();
|