-
Notifications
You must be signed in to change notification settings - Fork 44
feat : 5주차 과제 #205
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
feat : 5주차 과제 #205
Changes from all commits
3310a3d
2a442e0
9205bec
f8cbb54
6326152
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.loopers.application.product.dto; | ||
|
|
||
| import com.loopers.support.enums.SortFilter; | ||
|
|
||
| public record FindProductListReqDto( | ||
| String loginId, | ||
| String password, | ||
| Long brandId, | ||
| SortFilter sortFilter | ||
|
Comment on lines
+5
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: Yes. If you don’t declare your own Citations: Record에 평문 비밀번호를 포함하면 안 된다. Java record는 컴파일러가 자동으로 모든 컴포넌트를 포함하는 개선 방안:
추가 검증:
🤖 Prompt for AI Agents |
||
| ) { | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package com.loopers.domain.product.repository; | ||
|
|
||
| import com.loopers.domain.product.model.ProductItem; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Optional; | ||
|
|
||
| public interface ProductCacheRepository { | ||
|
|
||
| Optional<ProductItem> get(Long productId); | ||
|
|
||
| void put(Long productId, ProductItem item); | ||
|
|
||
| void evict(Long productId); | ||
|
|
||
| record CachedPage(List<ProductItem> items, long totalElements) {} | ||
|
|
||
| Optional<CachedPage> getFirstPage(); | ||
|
|
||
| void putFirstPage(List<ProductItem> items, long totalElements); | ||
|
|
||
| void evictFirstPage(); | ||
|
|
||
| Optional<Long> getLikeCount(Long productId); | ||
|
|
||
| void initLikeCountIfAbsent(Long productId, long count); | ||
|
|
||
| void incrementLikeCount(Long productId); | ||
|
|
||
| void decrementLikeCount(Long productId); | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
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: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 2249
🏁 Script executed:
Repository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 1420
🏁 Script executed:
Repository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 135
🏁 Script executed:
Repository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 256
🏁 Script executed:
Repository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 644
🏁 Script executed:
Repository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 287
🏁 Script executed:
Repository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 242
🏁 Script executed:
# ProductCacheRepository 인터페이스 확인 cat -n apps/commerce-api/src/main/java/com/loopers/domain/product/repository/ProductCacheRepository.javaRepository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 1033
🏁 Script executed:
# ProductCacheRepositoryImpl 구현 확인 cat -n apps/commerce-api/src/main/java/com/loopers/infrastructure/product/cache/ProductCacheRepositoryImpl.javaRepository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 3902
🏁 Script executed:
Repository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 165
🏁 Script executed:
Repository: Loopers-dev-lab/loop-pack-be-l2-vol3-java
Length of output: 6103
Redis 캐시 실패로 인한 DB-캐시 불일치 처리 필요
productService.increaseLikeCount에서 DB 업데이트는 트랜잭션 범위 내에서 성공하지만, Redis 캐시 업데이트가 실패하면 예외 대신 경고만 로깅하고 계속 진행된다. 이로 인해 DB에는 좋아요 수가 증가했으나 캐시는 이전 값으로 유지되어 조회 시 부정확한 데이터를 반환하는 운영 문제가 발생한다.개선 방안:
🤖 Prompt for AI Agents