Skip to content

Conversation

@Simzard10
Copy link
Contributor

#️⃣ 연관 이슈

(#99)

💻 작업 내용

(작업내용작성)

  • 조회수 증가 로직 increaseViews() 분리
  • 익명 사용자 처리 → handleAnonymousUser() 분리
  • 로그인 사용자 처리 → handleAuthenticatedUser() 분리
  • EventCommandService에서 해당 메서드 제거 및 리팩토링

테스트 결과 or 스크린샷 (선택)

작업한 부분을 캡처해 보여주면 이해하기 쉬워요

💬 리뷰 요구사항 (선택)

EventCommandService에서 조회수 처리 관련을 EventViewService로 분리했는데,
EventViewService 내부에서도 ViewCountPolicy 클래스를 두고, CookieViewService(비로그인, 쿠키로 조회수 중복 처리), RedisViewService(로그인, Redis로 조회수 중복 처리)를 나눠야할지 고민입니다.

생각한 구조

EventViewService
├── ViewCountPolicy
│ ├── AnonymousViewPolicy
│ └── AuthenticatedViewPolicy
├── CookieViewService
└── RedisViewService

@Simzard10 Simzard10 self-assigned this Mar 25, 2025
@jalju0804
Copy link

ViewCount 하는 것을 더 정교하게 만들 생각이 있다면, CookieViewService와 RedisViewService로 나눠서 관리하는게 맞다고 생각합니다
하지만 굳이 근래에 바꿀 생각이 없다면 오히려 redis 쪽 key를 만들거나 stringRedisTemplate 관련 로직들을 더 추상화를 잘해서 redis service에서 일반적으로 잘 처리할 수 있게 리팩토링 하는게 좋지 않나 생각이 듭니다..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants