From d4964ca7f1f824d6ea3f4c9444964f4661ffb5b2 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Sat, 29 Mar 2025 12:22:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xboe/school/study/service/impl/StudyServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java index 6a335430..39aadb6b 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyServiceImpl.java @@ -333,7 +333,7 @@ public class StudyServiceImpl implements IStudyService{ LocalDateTime now = LocalDateTime.now(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"); String value = lastStudyTime + "&" + now.format(formatter); // 使用ISO8601时间格式 - + log.info("-study-video-time-----value = " + value); // 20250303 优化 多次更新改一次更新 // 更新Redis中的最后活跃时间(带30秒过期) redisTemplate.opsForValue().set( @@ -341,12 +341,14 @@ public class StudyServiceImpl implements IStudyService{ value, Duration.ofSeconds(2592000) ); + log.info("-study-video-time-redis保存---value = " + value); // Duration.ofDays(30) 也就是 2592000秒 } @Override @Transactional public void updateStudyCourseItemLastTime(String studyContentId, int lastStudyTime,LocalDateTime timestamp) { + log.info("-study-video-time-定时---studyContentId = " + studyContentId + ",lastStudyTime = " + lastStudyTime + ", timestamp = " + timestamp); // 更新最后的学习时间点 LocalDateTime now=LocalDateTime.now(); UpdateBuilder update=UpdateBuilder.from(StudyCourseItem.class); @@ -356,6 +358,7 @@ public class StudyServiceImpl implements IStudyService{ update.addUpdateField("lastStudyTime", lastStudyTime); update.addUpdateField("lastTime", timestamp==null ? now : timestamp); scItemDao.update(update.builder()); + log.info("-study-video-time-mysql保存---studyContentId = " + studyContentId); } @Override