Skip to content

Commit

Permalink
Feat: visitorIp 로그 출력
Browse files Browse the repository at this point in the history
  • Loading branch information
hjinshin committed Nov 9, 2024
1 parent 336b660 commit 867442b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.ArrayList;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import supernova.whokie.global.annotation.RedissonLock;
import supernova.whokie.profile.service.ProfileVisitReadService;
Expand All @@ -14,6 +15,7 @@
import supernova.whokie.redis.service.dto.RedisCommand;
import supernova.whokie.redis.util.RedisUtil;

@Slf4j
@Service
@RequiredArgsConstructor
public class RedisVisitService {
Expand All @@ -24,6 +26,7 @@ public class RedisVisitService {
@RedissonLock(value = "#hostId")
public RedisVisitCount visitProfile(Long hostId, String visitorIp) {
RedisVisitCount redisVisitCount = findVisitCountByHostId(hostId);
log.info("visitorIp: {}", visitorIp);
if(!checkVisited(hostId, visitorIp)) {
redisVisitCount.visit();
redisVisitCountRepository.save(redisVisitCount);
Expand Down

0 comments on commit 867442b

Please sign in to comment.