From ab35ac8b769b2d9816dffb33a64f2c6f7bd5dd6e Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 05 九月 2024 17:05:55 +0800 Subject: [PATCH] 风行网页版爬虫 --- src/main/java/com/yeshi/buwan/service/manager/VideoPlayStatisticManager.java | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/yeshi/buwan/service/manager/VideoPlayStatisticManager.java b/src/main/java/com/yeshi/buwan/service/manager/VideoPlayStatisticManager.java index 677d200..2457ffd 100644 --- a/src/main/java/com/yeshi/buwan/service/manager/VideoPlayStatisticManager.java +++ b/src/main/java/com/yeshi/buwan/service/manager/VideoPlayStatisticManager.java @@ -3,6 +3,8 @@ import com.yeshi.buwan.dto.statistic.video.VideoDetailStatisticData; import com.yeshi.buwan.util.RedisManager; import com.yeshi.buwan.util.StringUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -13,6 +15,8 @@ */ @Component public class VideoPlayStatisticManager { + + Logger sessionLogger = LoggerFactory.getLogger("session"); @Resource @@ -35,15 +39,14 @@ } - public void consumeVideoDetailSession(String sessionId) { + public void consumeVideoDetailSession(String sessionId, String type) { String key = "session-" + sessionId; VideoDetailStatisticData data = (VideoDetailStatisticData) redisManager.getDataFromRedis(key); redisManager.remove(key); - //TODO 鍋氭棩蹇楄褰� if (data != null) { - + String st = String.format("%s#%s#%s", type, (System.currentTimeMillis() - data.getCreateTime()), data.toString()); + sessionLogger.info(st); } - } -- Gitblit v1.8.0