放开redis

This commit is contained in:
670788339
2024-08-15 16:26:47 +08:00
parent a26ee1c707
commit 61754d3852

View File

@@ -327,13 +327,13 @@ public class StudyCourseApi extends ApiBaseController{
StudyCourseItem item = studyService.checkHas(sci.getStudyId(),sci.getContentId());
// 20240815 特训营结营考试 临时代码
if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
redisTemplate.opsForValue().set(item.getId(),item.getId());
//设置过期时间为1天
redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
}else{
return success("");
}
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
// redisTemplate.opsForValue().set(item.getId(),item.getId());
// //设置过期时间为1天
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
// }else{
// return success("");
// }
if(item!=null) {
//如果记录存在但是进度不100无成情况就更新进度一期不会有这种情况
if(item.getProgress()<100 && sci.getProgress()>item.getProgress()) {
@@ -419,13 +419,13 @@ public class StudyCourseApi extends ApiBaseController{
if(item!=null) {
//如果记录存在但是进度不到100未完成情况就更新进度一期不会有这种情况
// 20240815 特训营结营考试 临时代码
if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
redisTemplate.opsForValue().set(item.getId(),item.getId());
//设置过期时间为1天
redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
}else{
return success("");
}
// if(item != null && redisTemplate.opsForValue().get(item.getId())==null){
// redisTemplate.opsForValue().set(item.getId(),item.getId());
// //设置过期时间为1天
// redisTemplate.expire(item.getId(), 60, TimeUnit.SECONDS);
// }else{
// return success("");
// }
if(item.getProgress()<100) {
studyService.updateProcess(item.getId(),sci.getStudyId(),sci.getCourseId(), sci.getContentTotal(),100,token);
}
@@ -532,13 +532,13 @@ public class StudyCourseApi extends ApiBaseController{
}
try {
// 20240815 特训营结营考试 临时代码
if(itemId != null && redisTemplate.opsForValue().get(itemId)==null){
redisTemplate.opsForValue().set(itemId,itemId);
//设置过期时间为1天
redisTemplate.expire(itemId, 60, TimeUnit.SECONDS);
}else{
return success(true);
}
// if(itemId != null && redisTemplate.opsForValue().get(itemId)==null){
// redisTemplate.opsForValue().set(itemId,itemId);
// //设置过期时间为1天
// redisTemplate.expire(itemId, 60, TimeUnit.SECONDS);
// }else{
// return success(true);
// }
studyService.finishVideoStudyItem(itemId, studyId,courseId,cnum,token);
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
log.info("在线课学习记录"+allUserList);