Skip to content

Commit

Permalink
Merge pull request #63 from CAUSOLDOUTMEN/fix/62-cache-fix
Browse files Browse the repository at this point in the history
Fix: Cache에서 key값 타입 수정
  • Loading branch information
synoti21 authored Nov 10, 2023
2 parents 37b3df6 + a32f694 commit 422cf50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Long saveFood(CreateFoodDto createFoodDto) {
}

// 회원이 특정 날짜에 먹은 음식 조회
@Cacheable(value = "ResponseFoodDto", key = "#userId+#date", cacheManager = "diareatCacheManager")
@Cacheable(value = "ResponseFoodDto", key = "#userId+#date.toString()", cacheManager = "diareatCacheManager")
@Transactional(readOnly = true)
public List<ResponseFoodDto> getFoodListByDate(Long userId, LocalDate date){
validateUser(userId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ void testSaveFood() throws Exception {
@WithMockUser("test")
void testGetFoodListByDate() throws Exception {
//Given
LocalDate date = LocalDate.now();
int yy = 2023;
int dd = 22;
int mm = 12;
LocalDate date = LocalDate.of(yy, mm, dd);

ResponseFoodDto food1 = ResponseFoodDto.of(testFoodId, testUserId,"test", LocalDate.now(), LocalTime.now(),testBaseNutrition,false);

Expand Down

0 comments on commit 422cf50

Please sign in to comment.