学习记录分页小改

master
wenyu441069198 5 months ago
parent a114edb1c6
commit b17033643c
  1. 2
      src/main/java/com/teaching/backend/controller/records/LearningRecordsController.java
  2. 2
      src/main/java/com/teaching/backend/service/impl/records/LearningRecordsServiceImpl.java

@ -31,7 +31,7 @@ public class LearningRecordsController {
*/ */
@GetMapping("/getall") @GetMapping("/getall")
public BaseResponse<Page> getAll(@RequestParam(value = "pagenum", defaultValue = "1") int pagenum, public BaseResponse<Page> getAll(@RequestParam(value = "pagenum", defaultValue = "1") int pagenum,
@RequestParam(value = "pagesize", defaultValue = "15") int pagesize, @RequestParam(value = "pagesize", defaultValue = "10") int pagesize,
@RequestParam String userId){ @RequestParam String userId){
List<LearningRecordsVo> cs= learningRecordsService.getAll(userId); List<LearningRecordsVo> cs= learningRecordsService.getAll(userId);

@ -104,12 +104,12 @@ public class LearningRecordsServiceImpl extends ServiceImpl<LearningRecordsMappe
break; break;
case "1": //如果是课程学习记录 case "1": //如果是课程学习记录
learningRecordsVo.setCoursesName(coursesService.getById(learningRecords.getCoursesId()).getName()); learningRecordsVo.setCoursesName(coursesService.getById(learningRecords.getCoursesId()).getName());
System.out.println(coursesService.getById(learningRecords.getCoursesId()).getName());
break; break;
} }
//添加观看人数 //添加观看人数
//统计记录表里有多少人查看过这门资源 //统计记录表里有多少人查看过这门资源
long count = this.count(lambdaQueryWrapper); long count = this.count(lambdaQueryWrapper);
System.out.println(count);
learningRecordsVo.setNumber(count); learningRecordsVo.setNumber(count);
//把整合后该用户的学习记录添加到List里 //把整合后该用户的学习记录添加到List里
list.add(learningRecordsVo); list.add(learningRecordsVo);

Loading…
Cancel
Save