Skip to content
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

Release 1.2.0 #92

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

Release 1.2.0 #92

wants to merge 16 commits into from

Conversation

DoohyunHwang97
Copy link
Collaborator

조회 성능 개선 및 캐시 설정 완료했습니다.
감사합니다(__)

"(:sex IS NULL OR i.sex = :sex) AND " +
"i.saleState IN ('ON_SALE', 'TEMPORARILY_SOLD_OUT')")
Page<Item> findAllByFilters(@Param("minPrice") Integer minPrice,
List<Item> findAllByFilters(@Param("minPrice") Integer minPrice,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QueryDsl 적용해서 동적쿼리 만들어주세요
아래처럼 불필요한 조건들이 없는 것이 더 명확합니다.

(:minPrice IS NULL OR i.salePrice >= :minPrice) 

"(:storeId IS NULL OR i.store.id = :storeId) AND " +
"(:sex IS NULL OR i.sex = :sex) AND " +
"i.saleState IN ('ON_SALE', 'TEMPORARILY_SOLD_OUT')")
Long countByFilters(@Param("minPrice") Integer minPrice,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

count 쿼리도 querydsl로 처리해주세요


@Transactional(readOnly = true)
@Cacheable(cacheNames = "ITEM_LIST",
key = "#categoryId + ':' + #storeId + ':' + #pageable.pageNumber",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

캐시 키에 pageNumber가 왜 있나요??

@Transactional(readOnly = true)
@Cacheable(cacheNames = "ITEM_LIST",
key = "#categoryId + ':' + #storeId + ':' + #pageable.pageNumber",
condition = "#pageable.pageNumber <= 3",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 조건을 넣으신 이유가 있을까요?

key = "#itemId",
cacheManager = "cacheManager")
@Transactional
public void deleteItemDetails(Long itemId) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

나중에 구현하실 메서들에는 주석으로 설명 넣어주시는게 좋습니다.
// TODO 추후 구현 예정

@@ -61,6 +63,7 @@ public void updateToSoldOut(Long itemOptionId, Boolean isTemporarily) {
.orElseThrow(() -> new ApiException(ErrorEnum.INVALID_REQUEST));

itemOption.beSoldOut(isTemporarily);
itemOption.getItem().renewSaleState();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

itemOption의 beSoldOut 메서드 안에서 item.renewSaleState를 호출하는게 맞지 않을까요??

public void reduceStock(Long itemOptionId, Integer amount) {
ItemOption itemOption = itemOptionRepository.findById(itemOptionId)
.orElseThrow(() -> new ApiException(ErrorEnum.INVALID_REQUEST));
Long stocksAfter = itemOption.reduceStocksCount(amount);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reduceStocksCount에서 남은 재고수를 반환하는 것보다는 itemOption에서 stockCount 필드를 직접 접근하는게 맞지 않을까요?

redisCacheConfigMap.put("ITEM_LIST_COUNT", defaultConfig.entryTtl(Duration.ofDays(1)));
redisCacheConfigMap.put("TOP_ITEMS_STORE", defaultConfig.entryTtl(Duration.ofMinutes(10)));
redisCacheConfigMap.put("TOP_ITEMS_CATEGORY", defaultConfig.entryTtl(Duration.ofMinutes(10)));
redisCacheConfigMap.put("STOCKS", defaultConfig.entryTtl(Duration.ofMinutes(10)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 하면 모든 캐시에 적용되는데 ttl 설정을 추가하신 이유가 있을까요??

@@ -39,13 +39,33 @@ jobs:
push: true
tags: wedowhatwedo/mall-qa:latest

- name: Deploy
- name: Deploy to server 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

파일 명이 qa-deploy 맞나요?? 개발서버 또는 운영서버에 배포하는거아닌가요?

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.

2 participants