Skip to content

Commit

Permalink
fix: 카테고리 문제 캐시 임시 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
yujamint committed Jul 10, 2024
1 parent 076f526 commit a62b41e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public class CategorizedProblemService {

private final ProblemService problemService;

@CacheEvict(value = "categorizedProblem", key = "#categoryId")
public CategorizedProblem createCategorizedProblem(Long categoryId, Long problemId) {
checkForDuplicateCategorizedProblem(categoryId, problemId);

Expand Down Expand Up @@ -229,8 +228,6 @@ public MemberSavedSummaryDto.pdfResponse createCategorizedProblemsPdf(Long categ
}
}


@CacheEvict(value = "categorizedProblem", key = "#categorizedProblem.category.categoryId")
public CategorizedProblem updateCategorizedProblem(Long categorizedProblemId, MemberSavedProblemDto.Patch problemPatchDto) {
CategorizedProblem categorizedProblem = findVerifiedCategorizedProblemByCategorizedProblemId(categorizedProblemId);
problemService.updateProblem(
Expand All @@ -241,13 +238,12 @@ public CategorizedProblem updateCategorizedProblem(Long categorizedProblemId, Me
}

@Transactional(readOnly = true)
@Cacheable(value = "categorizedProblem", key = "#categoryId")
// @Cacheable(value = "categorizedProblem", key = "#categoryId")
public Page<CategorizedProblem> findCategorizedProblemsByCategoryId(Long categoryId, int page, int size) {
PageRequest pageRequest = PageRequest.of(page, size);
return categorizedProblemRepository.findByCategoryCategoryId(categoryId, pageRequest);
}

@CacheEvict(value = "categorizedProblem", key = "#categorizedProblem.category.categoryId")
public void deleteCategorizedProblem(Long categorizedProblemID){
CategorizedProblem categorizedProblem = findVerifiedCategorizedProblemByCategorizedProblemId(categorizedProblemID);
categorizedProblemRepository.deleteById(categorizedProblemID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public class CategorizedSummaryService {

private final SummaryRepository summaryRepository;

@CacheEvict(value = "categorizedSummary", key = "#categoryId")
public CategorizedSummary createCategorizedSummary(Long categoryId, Long summaryId) {
checkForDuplicateCategorizedProblem(categoryId, summaryId);

Expand Down Expand Up @@ -76,7 +75,6 @@ public SummaryDto.pdfResponse createSummaryPdf(Long categorizedSummaryId) throws
return summaryService.createSummaryPdf(summaryId);
}

@CacheEvict(value = "categorizedSummary", key = "#categorizedSummary.category.categoryId")
public CategorizedSummary updateCategorizedSummary(Long categorizedSummaryId, SummaryDto.Patch summaryPatchDto) {
CategorizedSummary categorizedSummary = findVerifiedCategorizedSummaryByCategorizedSummaryId(categorizedSummaryId);
summaryService.updateSummary(
Expand All @@ -87,7 +85,6 @@ public CategorizedSummary updateCategorizedSummary(Long categorizedSummaryId, Su
return categorizedSummaryRepository.save(categorizedSummary);
}

@CacheEvict(value = "categorizedSummary", key = "#categorizedSummary.category.categoryId")
public void deleteCategorizedSummary(Long categorizedSummaryId) {
CategorizedSummary categorizedSummary = findVerifiedCategorizedSummaryByCategorizedSummaryId(categorizedSummaryId);

Expand All @@ -110,7 +107,7 @@ public CategorizedSummary findVerifiedCategorizedSummaryByCategorizedSummaryId(L
}

@Transactional(readOnly = true)
@Cacheable(value = "categorizedSummary", key = "#categoryId")
// @Cacheable(value = "categorizedSummary", key = "#categoryId")
public Page<CategorizedSummary> findCategorziedSummarysByCategoryId(Long categoryId, int page, int size) {
PageRequest pageRequest = PageRequest.of(page, size);
return categorizedSummaryRepository.findByCategoryCategoryId(categoryId, pageRequest);
Expand Down

0 comments on commit a62b41e

Please sign in to comment.