mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-06 17:36:47 +08:00
优化
This commit is contained in:
@@ -44,7 +44,7 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
||||
*/
|
||||
public void finishCheck(String studyId,String courseId,Integer total,String token){
|
||||
|
||||
if(StringUtils.isNotEmpty(redisTemplate.opsForValue().get(studyId))){
|
||||
if(StringUtils.isNotEmpty(redisTemplate.opsForValue().get(studyId + "_" + courseId + "_" + total))){
|
||||
return ;
|
||||
}
|
||||
|
||||
@@ -72,13 +72,13 @@ public class StudyCourseDao extends BaseDao<StudyCourse> {
|
||||
UpdateBuilder.create("lastTime",now),
|
||||
UpdateBuilder.create("finishTime",now),
|
||||
UpdateBuilder.create("status",StudyCourse.STATUS_FINISH));
|
||||
redisTemplate.opsForValue().set(studyId, "100", 24, TimeUnit.HOURS);
|
||||
redisTemplate.opsForValue().set(studyId + "_" + courseId + "_" + total, "100", 24, TimeUnit.HOURS);
|
||||
}else {
|
||||
super.updateMultiFieldById(studyId,
|
||||
UpdateBuilder.create("progress",percent),
|
||||
UpdateBuilder.create("lastTime",LocalDateTime.now()),
|
||||
UpdateBuilder.create("status",StudyCourse.STATUS_STUDYING));
|
||||
redisTemplate.opsForValue().set(studyId, String.valueOf(percent), 10, TimeUnit.SECONDS);
|
||||
// redisTemplate.opsForValue().set(studyId, String.valueOf(percent), 10, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyId ,courseId, token);
|
||||
|
||||
Reference in New Issue
Block a user