study接口加redis过滤

This commit is contained in:
670788339
2024-08-15 10:53:26 +08:00
parent f0fe015561
commit bddb11caf8

View File

@@ -321,8 +321,19 @@ public class StudyCourseApi extends ApiBaseController{
if (StringUtils.isEmpty(token)) {
token = request.getHeader("token");
}
// 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(), 60, TimeUnit.SECONDS);
}else{
return success("");
}
//检查是否已存在
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
if(item!=null) {
//如果记录存在但是进度不100无成情况就更新进度一期不会有这种情况
if(item.getProgress()<100 && sci.getProgress()>item.getProgress()) {