-
Notifications
You must be signed in to change notification settings - Fork 0
✨Feat: Like 도메인 캐시 적용(isLiked & likeCount) #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,5 +39,3 @@ src/main/resources/*.yml | |
| ### VS Code ### | ||
| .vscode/ | ||
|
|
||
| ## local docker compose | ||
| docker/docker-compose.local.yml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| version: "3.9" | ||
|
|
||
| services: | ||
| db: | ||
| image: postgis/postgis:16-3.4 | ||
| container_name: sportize-postgis-local | ||
| restart: unless-stopped | ||
|
|
||
| environment: | ||
| POSTGRES_DB: sportize | ||
| POSTGRES_USER: angora | ||
| POSTGRES_PASSWORD: password | ||
| TZ: Asia/Seoul | ||
|
|
||
| ports: | ||
| - "5432:5432" | ||
|
|
||
| volumes: | ||
| - sportize_pgdata_local:/var/lib/postgresql/data | ||
|
|
||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U angora -d sportize"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 5 | ||
| redis: | ||
| image: redis:7.2.4-alpine | ||
| container_name: sportize-redis-local | ||
| restart: unless-stopped | ||
| ports: | ||
| - "6379:6379" | ||
| command: ["redis-server", "--appendonly", "yes", "--requirepass", "password"] | ||
| volumes: | ||
| - sportize_redisdata_local:/data | ||
| healthcheck: | ||
| test: [ "CMD", "redis-cli", "-a", "password", "PING" ] | ||
| interval: 10s | ||
| timeout: 3s | ||
| retries: 5 | ||
| volumes: | ||
| sportize_pgdata_local: | ||
| sportize_redisdata_local: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: Sportize/be
Length of output: 110
🏁 Script executed:
Repository: Sportize/be
Length of output: 204
🏁 Script executed:
Repository: Sportize/be
Length of output: 110
🏁 Script executed:
Repository: Sportize/be
Length of output: 2534
🏁 Script executed:
Repository: Sportize/be
Length of output: 3197
🏁 Script executed:
grep -n "isLiked" src/main/java/com/be/sportizebe/domain/like/service/LikeServiceImpl.javaRepository: Sportize/be
Length of output: 137
비로그인 접근 시 SpEL NPE 위험이 실제로 발생할 수 있습니다.
getPostLikeStatus와getCommentLikeStatus엔드포인트에서@AuthenticationPrincipal User user는 인증이 없을 때 null을 주입합니다(required=true미설정). 인증 없이 이 엔드포인트들에 접근 가능하므로,isLiked메서드의 캐시 키 표현식#user.id에서 NPE가 발생합니다.null-safe 처리를 추가해 주세요:
💡 null-safe 처리 예시
🤖 Prompt for AI Agents