study接口加redis过滤

This commit is contained in:
670788339
2024-08-15 11:35:02 +08:00
parent 8e1b7519ef
commit be3bae969c

View File

@@ -418,6 +418,14 @@ public class StudyCourseApi extends ApiBaseController{
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
if(item!=null) {
//如果记录存在但是进度不到100未完成情况就更新进度一期不会有这种情况
// 20240815 特训营结营考试 临时代码
if(redisTemplate.opsForValue().get(sci.getStudyId()+sci.getContentId())==null){
redisTemplate.opsForValue().set(sci.getStudyId()+sci.getContentId(),sci.getStudyId());
//设置过期时间为1天
redisTemplate.expire(sci.getStudyId()+sci.getContentId(), 5*60, TimeUnit.SECONDS);
}else{
return success("");
}
if(item.getProgress()<100) {
studyService.updateProcess(item.getId(),sci.getStudyId(),sci.getCourseId(), sci.getContentTotal(),100,token);
}